Is there a way...(User versus Program)

JaedenRuiner

Well-known member
Joined
Aug 13, 2007
Messages
340
Programming Experience
10+
So, we have, say a ComboBox, which we will limit to a databound DropDownList, DisplayMember returns a type of String where ValueMember is an Integer. (that is the type of what those properties point to)

Now, there is SelectedIndexChanged, SelectedValueChanged, even a SelectedItemChanged, and dependent on how one wishes to handle the value changing in the ComboBox you can trap any combination of the three.

However, if i say: MyCombo.SelectedValue = X
the event triggers (granted that selectedvalue did not equal X prior to that line).

If the User click on the combo box and changes values, the event triggers.

Is there a way to determine (intrinsically) whether or not the change was caused by a user action versus a programmatic one?

Thanks
 
You could try setting a boolean right before you programmatically change the SelectedValue then after you've changed it, turn the boolean off. That way in the event you can check the boolean and you'll know if it was a user change or not.
 
yea, i know...that's not intrinsic, that's ex-trinsic :D

I'm just trying to cut down on my boolean flag variables....

this app already is a memory hoss, and i know a boolean isn't much, but well, tis un-important really. the control is current disabled so the user can't change it, but i was thinking about revising that...but I can't so I won't. it would be far to complicated a change now.

thanks anyway.
 
Back
Top