1: A new type:
Enumeration:
Enumeration is a descriptive name
Define a limited set of values that cannot contain methods
To constrain a possible value
Enumeration guarantees the rationality of the assignment
2:
public enum grader (name of enum) {Male,female} public Gander Studentgrader; Public Gander studentgrader{get{return studentgender;} set{Studentgender =value; }} the enumerator represents the integer value Console.WriteLine (the "Gender value is: {0}", (int) student. Studentgender);//Gets the integer value (int) student represented by the number of enumeration values. Studentgender); The default value of the initial value can be modified from zero to the initial value code: public enum Gender{male=1,famale = 2}
3: The enumeration is converted to the form of a string:
public enum gender{Male,famale}//... Console.WriteLine ("My Name: {0}, Gender: {1}", this.) Name,this.studentgender.tostring ()); Converts the bit string Tostring ();
4: String conversion to enum type:
(Gender) (Enum.parse (typeof (Gendder), "Male")); Gets the name of the enumeration type required to convert the string typeof
5: How to display pictures on a form:
PictureBox controls
Image |
Display a picture in a control |
SizeMode |
How to handle the relationship between image and control size |
ImageList |
Store pictures |
6: Properties and events for timer controls (tirm)
InterVal |
The frequency, in milliseconds, at which the event occurred. |
Enabled |
Whether to raise events regularly |
Event
Start () |
Start timer |
Stop () |
Stop Timer |
Attention:
If you find that the Timer control does not work, check that the Enable property is set bit true and the default is False
7: Record the index of the displayed picture when adding a field
If the currently displayed picture index does not have a maximum value, continue to increase
The number of images in the IF (index<this.ilabout.image.count-1)//imagelist {index++;} else{
Otherwise, start with the first one index = 0;} Set picture box to display picture of this. Pbabout.image =ilabout.images[index];---Get the location image specified in ImageList
Note: The definition and initialization of the index variable cannot be written in the program in which the tick event is handled, otherwise the picture cannot be rotated
Summarize:
1: Use the PictureBox control to display pictures on a form
2: Use the Timer control D to allow the program to do one thing at a time at intervals
3: The form is displayed in two ways:
Mode form: Use the Showdailog () method to display a form as a modal form
Non-modal forms: Use the Show () method to display a form as a modal form
Implementing data updates for Windows programs