Enable Button when Comboboxitem is selected

222
3
04-02-2019 05:19 AM
Highlighted
New Contributor II

Hi,

I have a Combobox and a Button. The button should be disabled until there is something selected in the Combobox. How can i achieve this with the ArcGIS Pro SDK?

Thanks for any help.

Urs

Reply
0 Kudos
3 Replies
Highlighted

You need to create an event on the ComboBox.SelectionChange.  Inside that event handler use 

button.Enabled = true;
Reply
0 Kudos
Highlighted
New Contributor II

Maybe my topic wan't clear. The Button is a MapTool and the Combobox is is also in the ArcGIS pro Ribbon. So my question is how I can get a reference in the MapTool Object (Button) to Combobox Object and vice versa.

Highlighted
Esri Regular Contributor

Hi,

You can implement States and Conditions to enable/disable controls on the ribbon.

ProGuide: Code Your Own States and Conditions

Sample: Working with DAML This sample has a section that creates a custom state and condition.

Thanks

Uma