I’m creating a VSTO VB On Visual Studio for MS Visio. I have created a Ribbon with buttons, all works well then I’ve made a DropDown and I want to get back the selected Item. So I created the OnAction into the XML File, and in the CutomRibbon.vb I’ve created the public sub with a MsgBox just to test the OnAction, but it doesn’t react.
Here’s the XML code:
<group id="MLED_Group" label="Mur LED">
<button id="MLEDBtn" label="Insérer un Mur LED" onAction="MLEDBtn_Click" size="large" imageMso="AbstractAssociation"/>
<dropDown id="ListeCabalge" label="N° de circuit :" onAction="OnColorChange" enabled="true">
<item id="Item1" label="Data 1"/>
<item id="Item2" label="Data 2"/>
<item id="Item3" label="Data 3"/>
<item id="Item4" label="Data 4"/>
<item id="Item5" label="Data 5"/>
<item id="Item6" label="Data 6"/>
<item id="Item7" label="Data 7"/>
<item id="Item8" label="Data 8"/>
<item id="Item9" label="Data 9"/>
<item id="Item10" label="Data 10"/>
</dropDown>
<button id="CMLEDBtn" label="Commencer le câblage" onAction="CMLEDBtn_Click"/>
<button id="stopCablingButton" label="Arrêter le câblage" onAction="OnStopCablingClick"/>
</group>
And here’s the VB code:
Public Sub OnColorChange(ByVal control As IRibbonControl)
MsgBox("Je viens dêtre appelé")
'CablingColor = selectedId
End Sub
So I want the MsgBox to show up for the moment to make sure it work. I’ve tried to put the code in CustomRibbon.vb and into ThisAddIn.vb but still the same. I’ve also tried to change ByVal control As IRibbonControl
for ByVal control As Office.IRibbonControl
. Same.
michael centenico is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.