I am new in windows application development. basically i am web developer. but though i want to understand the sequence of events execution in following scenario:
I have win form. it has a button. i am handling开发者_C百科 the button click event. when i get run my application as usually FormLoad event must execute first. but what after i clicks the button ? will form load execute again before button's click event Or form load executes after button click event. Even i can check it my self , but as i tried this i found no sense there as i explained. in fact i wanted to reload my win form on button click with some static parameters (kept in static class). guide me please.
The only thing that happens when you click a button in an application, is the click event is raised, and handled.
Why would a native application re-load the window? Free your mind from this web-type-thinking!
In fact, if you want to re-load the window you should probably have another look at your design, it sounds like it's a bit too web-like. Why are you re-loading the window? If it's just to set some properties, then just set the properties in the click event handler.
- First form
load_event
is fired - After that
button_click
event will be fired - If you click button only
button_click
event fired - Whenever you click reload that time
form_load
fired.
精彩评论