I have a form in VB.Net, populated with a dropdown control. I have a "SelectedIndexChanged" event tied to this control; and when the user makes a selection, changing the contents of this control, that triggers code to perform a check on the value they've chosen. In this context, everything works as it should.
When the form opens, coding initiates the population of this control with a value it receives from the registry, thus insuring, for the user, a continuity of parameter settings between each execution of the program. Unfortunately, this first-time, coding-initiated setting of the control value also performs the same check, with undesirable consequences. Below is a screenshot of the call stack with a coding-triggered check, as evidenced by the gap that saying "[External Code]". How do I make the triggered code aware of what action triggered it, so as to make intelligent choices of what actions to take, based on this information?
I feel the question is a very important component of writing professional code, in which event-driven code leverages the context in which it was called to take appropriate action. Kind regards, ~Peter Ferber