Click here to Skip to main content
Sign Up to vote bad
good
See more: C#Win7
Can I declare a boolean variable by considering form loading.Ex:I need to declare a boolean variable, before the form loading "true" after the form loading "false".
Posted 9 Jan '13 - 21:51

Comments
Shanu2rick - 10 Jan '13 - 3:54
Winforms or Webforms?
NISHAN SANDEEPA - 10 Jan '13 - 3:58
Sorry dear... Winform.....
Shanu2rick - 10 Jan '13 - 4:06
See the solution 1, also declared the boolean variable in Load Event, set it to true. Then change the value on very next event you want.
NISHAN SANDEEPA - 10 Jan '13 - 4:12
Are there any alternatives for this without using a public variable.

1 solution

Use the Form_Load event.
It will be much easier for you to start with a boolean false and then set it to true once the form_load event completes.
The bool flag remains false until the form is loaded.
  Permalink  
Comments
NISHAN SANDEEPA - 10 Jan '13 - 4:20
Can I use a variable between InitializeComponent().If it is can please give me an example.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 OriginalGriff 286
1 Mohammed Hameed 208
2 Sergey Alexandrovich Kryukov 188
3 Santhosh G_ 108
4 Mayur_Panchal 98
0 Sergey Alexandrovich Kryukov 8,216
1 OriginalGriff 6,271
2 CPallini 3,528
3 Rohan Leuva 2,703
4 Maciej Los 2,234


Advertise | Privacy | Mobile
Web04 | 2.6.130516.1 | Last Updated 10 Jan 2013
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid