New course! Every coder should learn Generative AI!
Try a free lesson+ 3
When you want to use a variable. you should set a property, that all methods of your class can use it...
you defined a value for Constructor (Win Method), So other methods cant get/set this value...
....
partial class Win : Form
{
static Button b;
public Win()
{
b = new Button();
}
....