Custom visio toolbar with combobox 
Author Message
 Custom visio toolbar with combobox

well this program was supose to create a toolbar with combobox with list
iside, but it creates empty combobox
You can try it for yourself (needs no extra code).

What changes do i have to do to make this script work?
Any ideas?

If you change visCtrlTypeCOMBODRAW with visCtrlTypeDROPBUTTON to see that
this script works

'###########################################################################
######
Sub AddToolbar_withcombobox()

    Dim uiObj As Visio.UIObject
    Dim toolbarsObj As Visio.Toolbars
    Dim toolbarObj As Visio.Toolbar
    Dim toolbarItemsObj As Visio.ToolbarItems
    Dim toolbarItemObj As Visio.ToolbarItem

    Set uiObj = Visio.Application.BuiltInToolbars(1)
    Set toolbarsObj =
uiObj.ToolbarSets.ItemAtID(Visio.visUIObjSetDrawing).Toolbars

    Set toolbarObj = toolbarsObj.Add 'create new toolbar
    Set toolbarItemsObj = toolbarObj.ToolbarItems
    toolbarObj.Caption = "Lists"
    toolbarObj.Position = Visio.visBarFloating
    toolbarObj.Visible = True
    toolbarObj.Enabled = True

     Set toolbarItemObj = toolbarItemsObj.AddAt(1)   'create new item in
newtoolbar
     toolbarItemObj.ActionText = "Dosmth"
     toolbarItemObj.AddOnName = "msgbox""aa"""
     toolbarItemObj.Caption = "aaa"
     toolbarItemObj.Width = 320

     toolbarItemObj.CntrlType = visCtrlTypeCOMBODRAW 'visCtrlTypeDROPBUTTON

    For i = 0 To 5  'create list

     toolbarItemObj.ToolbarItems.Add
     toolbarItemObj.ToolbarItems(i).Caption = "sasas" & i
     toolbarItemObj.ToolbarItems(i).AddOnName = "msgbox""aa"""
     toolbarItemObj.ToolbarItems(i).ActionText = "saddsd"

    Next

    ThisDocument.SetCustomToolbars uiObj
    ThisDocument.CustomToolbars.UpdateUI

End Sub



Mon, 02 Feb 2004 21:28:57 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Custom visio toolbar with combobox

2. create custom icon,custom combobox in custom toolbar

3. create custom icon,custom combobox(to insert values)in custom toolbar

4. how to add tooltips to custom buttons on custom toolbar

5. Problem with custom toolbar in custom template

6. More Custom Menu Problems in Visio 2002

7. Visio 2K Custom Properties Drop-Down

8. custom windows in my Visio solution

9. Custom menus in Visio

10. Custom Menu in Visio 2002

11. Visio 2002 custom menu frustration

12. Disabled custom menu items with VISIO 2002

 

 
Powered by phpBB® Forum Software