c# - ListBox.SelectedIndexChanged - can you determine if it was user intiated? -


My question is similar to:, but I want to ask it in a different way.

Is there an easy way to decide whether or not the 'Selected Index Cheng' is being opposed to starting the user through the code (for example, ListBox.SelectedIndex = x) ?

As far as I know, no, there is no easy way to make it. The best I am able to do, the flag is set before it is converted to the code and then let the event handler reset the flag and reset.

I think you can start investigating the call stack and see whether it is happening in your own code or not, but I'm not sure how much it is worth the effort.


Comments