Select to view content in your preferred language

A Possible Bug of Arcmap Add-In Combobox

858
1
12-22-2013 09:02 PM
HaoliangYu
Emerging Contributor
Hello, I am using C# to develop an Arcmap addin. I wonder whether there is a bug at the function ComboBox.GetItem().

I tried to run the following code when the combobox was initialized: (an item is already added)
MessageBox.Show(this.GetItem(0).Caption)

but it failed to popup a messagebox. So I used this.items(0).Caption instead and it worked.

So I guess there is difference between ComboBox.GetItem(index) and ComboBox.items[index]. Or there may be a bug.

btw, is there a way that the add-in can get access to events of controls at ArcMap? For example, directly response to the layer addition or deletion.
0 Kudos
1 Reply
HaoliangYu
Emerging Contributor
It is my mistake. The cookie that the ComboBox.Add() returns does not start from 0. It is not a normal index.
0 Kudos