Add ComboBox in the Ribbon Quick Access Toolbar (QAT)

Add ComboBox in the Ribbon Quick Access Toolbar (QAT)

ngdnam88
Advocate Advocate
282 Views
2 Replies
Message 1 of 3

Add ComboBox in the Ribbon Quick Access Toolbar (QAT)

ngdnam88
Advocate
Advocate

Dears,

I'm looking for guide to add a "ComboBox" looks like in the Ribbon Quick Access Toolbar (QAT)

ngnam1988_1-1741968991028.png

Please help me. Thanks,

0 Likes
Accepted solutions (1)
283 Views
2 Replies
Replies (2)
Message 2 of 3

WCrihfield
Mentor
Mentor
Accepted solution

Hi @ngdnam88.  This is not an area I focus on, so the links below, and quickie code example are just for general reference and guidance, and shouldn't be used 'as is', without quite a bit of customization.

Application.CommandManager 

CommandManager 

CommandManager.ControlDefinitions 

ControlDefinitions 

ControlDefinitions.AddComboBoxDefinition 

ComboBoxDefinition 

ComboBoxDefinition.AddItem 

 

Application.UserInterfaceManager 

UserInterfaceManager 

UserInterfaceManager.ActiveEnvironment 

Environment 

Environment.Ribbon 

Ribbon 

Ribbon.QuickAccessControls 

CommandControls 

CommandControls.AddComboBox 

 

Dim sDispName As String = "MyComboBox1_DisplayName"
Dim sIntName As String = "MyComboBox1_InternalName"
Dim eClassification As CommandTypesEnum = CommandTypesEnum.kQueryOnlyCmdType
Dim iDropDownWidth As Integer = 25

Dim oCDs As ControlDefinitions = ThisApplication.CommandManager.ControlDefinitions
Dim oComboBoxDef As ComboBoxDefinition = oCDs.AddComboBoxDefinition( _
sDispName, sIntName, eClassification, iDropDownWidth)
oComboBoxDef.AddItem("ComboBoxItem #1")
oComboBoxDef.AddItem("ComboBoxItem #2")

Dim oQuickAccessControls As CommandControls = ThisApplication.UserInterfaceManager.ActiveEnvironment.Ribbon.QuickAccessControls
Dim oCmdCntrl As CommandControl = oQuickAccessControls.AddComboBox(oComboBoxDef)

 

 

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 3 of 3

ngdnam88
Advocate
Advocate

Hi @WCrihfield 
I got the solution now. Thanks!

0 Likes