Select to view content in your preferred language

Enable Button when Comboboxitem is selected

1227
3
04-02-2019 05:19 AM
UrsRichard
Emerging Contributor

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

0 Kudos
3 Replies
MatthewDriscoll
MVP Alum

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

button.Enabled = true;
0 Kudos
UrsRichard
Emerging Contributor

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.

UmaHarano
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