1
Answer

Declaring variables in Windows form

ray dona

ray dona

15y
3.2k
1
Hi,
Can anyone tell me what is the best way to declare and initialize variables to be used in a Windows form at file level (to be used by the form where the variable is declared) and at global level (to be used by several forms). I’ve been declaring variables under ‘Required designer variable’ as shown below and initializing the variables in Page_Load event (I don’t want to mess around with the form’s constructor as it causes the designer window not to function). I would be very grateful.
private:
/// <summary>
/// Required designer variable.
/// </summary>
Answers (1)