Chapter One: The first knowledge of Windows programs
1: Create a Windows program
2. Note the point:
/*01. A solution can contain multiple projects,
* multiple forms can be included under an item
* 02. How do I set a form under a project as the startup form???
* Parse: By changing The last line of code in the Program.csmain method setting
* 03. control's Name property is equivalent to a hidden value , be sure to change
* The text property that really displays content on the form
Exam
* 04. If there are multiple projects under a solution, how do I set a project as a startup item??
* Resolution: You can right click on the item → Set as Startup item
* 05. How to save the project in the computer room, or how to open it after saving ???
* Resolution: You can save the solution to the specified project, the next time
* Open the sln file directly
How can I change the size of a form after it has been run?
* Resolution: The following settings:
*01. Disable the Maximize button
* 02. Set FormBorderStyle property is any one of the Fixed the properties that begin with are OK
MessageBox
parameter one: prompt information
Parameter two: Title text
Parameter three: Button settings
Parameter four: Icon setting
MessageBox.Show ("Congratulations, the jackpot is 500, will you please eat?" "," The Warm Hint ", messageboxbuttons.yesno,messageboxicon.warning);
. form Pass -through value
parsing: passing the login user name from the login form to the main form, you can define a public variable in the main form, and then Login write the following code in the form's Login button event:
Main Frm=new main ();
Frm.name=txtname.text;
frm. Show ();
The Label control is then assigned a value in the load event of Main .
Real Exit Procedure
In the formclosing event of the form , write application.exit ();
any control in the toolbox is a class, and once you drag him onto The form , he becomes an object, and you can go through the F4 shortcut keys in the Properties window, assign values to each of her properties.
Developing a database application system using C #