Hi,
During formload
vb triggers all kinds of events including events like check state changed of checkboxes. But I only would like to update my form during formload and don't want code inside these events got executed.
Ofcoarse I could turning off and on a boolean variable at start and and of the formload, but that's seems to be a solution like 'goto 209', so I'm looking for a better one. One that is universal to all projects.
In VB6 my solution to this problem was to let events (that would be fired by formloads) question if they themselves were the activecontrol or not. If not they were fired during formload, if yes they were fired by the user (and would execute the related code).
Somehow in
vb.net checkboxes somehow always return true on the 'me.activecontrol is controlobj'-solution. So that's no reliable solution anymore.
So my question is; how do you prevent your control-events-code from being executed by the formload?
Another solution that I thought of is to remove all control-eventhandlers at the start of the formload and put them all back at the end of the formload event.
I understand it's a far away solution to this problem, but I wonder if it's possible.
For this reason for some time now I'm looking for a way to do this... remove all event-handlers of a fom in runtime, but unfortunately I didn't find usable info on google yet.
What I dÃd find was code to remove all handlers for one particular event, but what I want to do is remove all handlers for ALL events of a form (like click and leave events).
Next to that I'd like to store the handles in a temporarly list to restore the handles later.
I want to do this to have some universal solution to avoid the automatic triggers of checkboxes/radionbuttons etc. during formloads.
Thanx in advance again!