Hello.
I have a ComboBoxTool on my UltraWinToolbar.
I am populating the list at runtime like this:
public void addDevice(object newDevice) { deviceComboBox.ValueList.ValueListItems.Add(newDevice, newDevice.ToString()); }
What I need to do is get that 'newDevice' object out when the user selects a new list member in the comboBox.
I am currently using the ToolValueChanged event to hopefully find a reference to the object associated with this new selection. Is that object actually in the ToolEventArgs that the event provides, or am I on the wrong track.
Thanks!
Uhh...looks like the control truncated my paste...not good. :)
void OnDeviceComboBoxValueChanged(object sender, ToolEventArgs e) { deviceSelected(this, new DeviceEventArgs((DeviceName)deviceComboBox.
ValueList.ValueListItems[deviceComboBox.ValueList.SelectedIndex].DataValue)); }
UPDATE:
I found A solution...seems a little longwinded, but maybe its the most direct way...
void OnDeviceComboBoxValueChanged(object sender, ToolEventArgs e) { deviceSelected(this, new DeviceEventArgs((DeviceName)deviceComboBox.ValueList.ValueListItems[deviceComboBox.ValueList.SelectedIndex].DataValue)); }