····· Genesis indows Program
1. New Project Project type: Visual C # project, template : Windows Application
2. Use partial to separate the code of the same form into two files;
A code stored in VS auto-generated
A store of code that we write ourselves
2. Recognize form Classes
3. Window Common Properties
Window Title: Name
Icon for the form: icon
Background Image: BackgroundImage
Background color: BackColor
Background style: BackgroundImageLayout
Maximize button: Maximinbox
Minimize button: Minimun
Form side Shopping Style: Fromborderstyle
FixedSingle: Parameter prevents changes to window size
FIXED3D: Parameter prevents changes to window size
Form initial Position: StartPosition
Centerscreen: The parameter screen is displayed in the middle
Form Status: Windowsstate
········ Designing a login Form
Control naming conventions
Control Name control class name naming prefix
Tag Label IBI
Text box textbox txt
Combo Box ComboBox CBO
Pushbutton button BTN
Tag Label:
Image: Images on a label
Text: Display of texts
Label TextBox:
MaxLength: Maximum number of characters
Multiline: Whether multiple lines of text can be entered
PasswordChar: Set the displayed password character as a password box
ReadOnly: Whether to allow edit true does not allow
Text: Associated Literals
Combo box combobox:
Items: item in a combo box
DropDownStyle: Style of combo box
Text: Combo box associated
Selectdindex: Index of the currently selected item, starting at 0
SelectedItem: Gets the currently selected item
Buttons: button:
Enable: Whether the control is available
Text: The file displayed
TextAlign: How text is aligned
··········· event-driven mechanisms
Windows Application Event Driver
Event-driven: respond to user events at any time and make appropriate processing
Steps for writing event handlers
1. Select the control
2. In the Properties window, click
3. Find Events
4. Double-click the Generate event handling method
5. Write the processing code
······· message box
Why Use a message box
displaying messages, requesting information from users
How to display a message box
Using the MessageBox object
How to create a message box
Using the MessageBox.Show () method
The simplest message box:
MessageBox.Show (the string to display)
message box with caption: if
MessageBox.Show (The string to display, the caption of the message box)
message box with caption, Button: if
MessageBox.Show (The string to display, the caption of the message box, the message button)
with title. Button. Icon's message box:
MessageBox.Show (string to display, message box caption, message box button, message box icon)
Example: private void Bthcancel_click (object sender, EventArgs e)
{
DialogResult result = MessageBox.Show ("Confirm Cancel login?"). "," Operation Tip ", messageboxbuttons.yesno,messageboxicon.question);
if (Result==dialogresult.yes)
{
This. Close ();
}
}
"" "User input validation
············· implement a jump between forms
Step: 1 Define the Form object
2 Display Form
The called Form class name Form object =new the Called Form class name ();
The Form object. Show ();
Developing a database application system using C #