Implementing data updates for Windows programs

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.