CodePudding user response:
Static class called directly; Call non-static need instanceCodePudding user response:
Static class called directly; Call non-static need instanceCodePudding user response:
A new class of object you wroteCodePudding user response:
Double click the button in the designer interface button, jump to the code, automatically generatedPrivate void button__Click (object sender, EventArgs e)
{
//call you here to write a good class
//if it is a static class
The name of the class. The method name (argument);
//if it is not a static class
The name of the class object name=new class name ();//constructor parameter is passed parameters, the default is no arguments structure;
The object name. The method name (argument);
}
PS: pay attention to what you write is Public class; Otherwise the classes you write permissions region here authority;
CodePudding user response: