r/csharp•
thewolf20

[Beginner] Why can't we access a Windows Forms Component from the Form1 class main body?

Why can we only access Windows Forms Components (Like buttons, panels etc.) in methods within the Form1 class but not from the Form1 class main body (if I try to do that, I get the error: "The name 'button1' does not exist in the current context")? Since I'm a beginner, an easy explaination would be great.

Posted Apr 14, 2017, 4:51 PM UTC

111
Loading comments…