01. Menu bar (MenuStrip)
To set the shortcut key mode:
Mode one: 1. Set the Text property of the menu item to (Open (&f)),
You must first press ALT + main Menu shortcut key to enter the corresponding main menu,
Then press f directly to open the subform.
Mode two: The Shorcartkeys property is set by the menu item.
To create the corresponding key combination, you can press the main interface directly into the corresponding
Letter keys to open subforms
The drawing of the dividing line:
01. Inserting a split line
02. Enter a minus sign (-)
02. Toolbars (ToolStrip)
01. Set the picture to the toolbar item, first the picture size is controlled by the whole ToolStrip,
Sets the imagescalingsize value to the pixel value of the picture itself.
02. Add the type of each item to DropDownButton
03. Set the Text property to display
04. Set the Displaystyle property to ImageAndText so that the picture and text are displayed simultaneously
The relative position of the 05.TextImageRelation image and the text
Application. Exit () and This.close ()
Application.exit ();//exit the entire application
This. Close ();//Closes the current form
04. Use of Common controls
RadioButton
Datetimerpicker
GroupBox
Panel
06.Anchor and Dock Properties
Anchor: The pixel value that keeps the position of the control and the edge of the form fixed.
Dock: Make a control dock to a part of the form (top,bottom,left,right), or fill the entire form (fill)
07. Setting up an MDI form
001. Set the IsMdiContainer property of the main form to True
002. Add the following code before the subform show ():
Write
1 frm. mdiparent=this; // This represents the current form
Object-oriented promotion: As long as the point can be set by the mouse properties of the place, can be implemented through code, but the code can not achieve all can be achieved through a mouse point!
08. The things about ReadOnly
If you set the ReadOnly property on a textbox, setting the font foreground color is not working, and you must set the BackColor to any of the colors outside the control.
09. How to bind data in a grade table in a database to a drop-down box
Parse: The interface on the Grade drop-down box shows the grade name, and the student table is the grade number, how to do??
1 parsing:publicint getidbyname (string gradename)23 {4 5 string sql="select Gradeid from grade where gradename= '"+gradename+ "'"; 6 7 }
The 2nd chapter How to build a well-laid Windows program