Message 1 of 17
Combo Box on a ribbon panel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I've been trying to make a combo box on a ribbon panel and I've got it working in a very basic mode:
mDwgCombo = mCtrlDefs.AddComboBoxDefinition("Current DimStyle", _ "JZComboDS", _ CommandTypesEnum.kShapeEditCmdType, _ 100, _ strAddInGuid, _ "Current Dim Style", _ "Displays current Dim Style", _ mIPicturedispDSsm, _ mIPicturedispDS, _ ButtonDisplayEnum.kDisplayTextInLearningMode) mDwgCombo.AddItem("X", 0) mDwgCombo.AddItem("Y", 0) mDwgCombo.ListIndex = 1
That loads up just fine. There's no event attached to it at this point, however upon loading an idw file, i get a combo box in the menu with 2 choices, X and Y with a default choice of X. That's fine.
However, I don't want X and Y in the list, i'd like to populate it with the list of existing styles. I have a pop up form that does this, but am trying to convert to a combo box on the ribbon. I tried the following, but it kills the whole addin.
Dim oDrgDoc As DrawingDocument oDrgDoc = g_inventorApplication.ActiveDocument Dim oDrgStlMgr As DrawingStylesManager oDrgStlMgr = oDrgDoc.StylesManager Dim i As Integer Dim n As String For i = 1 To oDrgStlMgr.StandardStyles.Count n = CStr(oDrgStlMgr.StandardStyles.Item(i).Name) mDwgCombo.AddItem(n, 0) Next
Any ideas what I need to do to get the list in the combo box?
(FWIW this in the Standard AddInServer.vb file)
thanks
Mike