Help: Set Button Size with Large Size in Default

Help: Set Button Size with Large Size in Default

ngdnam88
Advocate Advocate
506 Views
2 Replies
Message 1 of 3

Help: Set Button Size with Large Size in Default

ngdnam88
Advocate
Advocate

Dears,

I'm a new in API with VS. Please help me how to set the Button Size in the Ribbon Tab with large size in default or large size only?  - I'm using this code.  (In this case I wanna some button always in large size = "LargeIcon_32x32")

Dim oCtrlDefs As ControlDefinitions = m_inventorApplication.CommandManager.ControlDefinitions
mButtonDef = oCtrlDefs.AddButtonDefinition( _
		"Custom Cmd", _
		"Company:AddInName:Button1", _
		CommandTypesEnum.kQueryOnlyCmdType, _
		"AddInGuid", _
		"Description", _
		"Tolltip text", _
		StandardIcon_16x16, _
		LargeIcon_32x32, _
		ButtonDisplayEnum.kDisplayTextInLearningMode)

Thanks you!

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

JelteDeJong
Mentor
Mentor
Accepted solution

In the code that you shared the ControlDefinition is defined. The button size is a property of the CommandControl. in your code you should have something like this:

Dim ribbon As Ribbon = _inventor.UserInterfaceManager.Ribbons.Item("Assembly")
Dim ribbonTab As RibbonTab = ribbon.RibbonTabs.Item("id_TabManage")
Dim ribbonPanel As RibbonPanel = ribbonTab.RibbonPanels.Item("iLogic.RibbonPanel")
Dim control As CommandControl = ribbonPanel.CommandControls.AddButton(mButtonDef)
control.UseLargeIcon = True

 

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

Message 3 of 3

ngdnam88
Advocate
Advocate

Thank you very much! @JelteDeJong 

0 Likes