Events for Forms

Source: Internet
Author: User

Delete Event: The event page inside of the hanging of the event deleted, and then delete the background code inside the event

A panel is a container

1, Label--Text Display tool
Text: Display of words
Value, Assignment: Lable1. Text

2, TextBox--text box
Value, Assignment: TextBox1.Text

3, RichTextBox--Text field

4. Button--buttons
Click events: Double-click the button

5, RadioButton--radio button
Checked property: Whether to select
foreach (Control i in Panel1. Controls)
{
if (i is RadioButton)
{
RadioButton RA = i as RadioButton;
}
}
If you want to group, place the same group of buttons under the same container

6. CheckBox
Checked property: Whether to select
Tag property: can store custom data
If you want to group, place the same group of buttons under the same container

7. listbox--list Box
Show Data:
Specifying a data source for a ListBox
Listnation.datasource = da. Select ();
Specify values to display
Listnation.displaymember = "Name";
Specify the background value value
Listnation.valuemember = "Code";

Take the value of the selected item:
ListNation.SelectedValue.ToString ()
Listnation.selecteditem as nation;//the selected item, the entity object is taken
If you select more than one data check value:
foreach (Nation data in Listnation.selecteditems)
{
MessageBox.Show (data. Code);
}

Set an item selected:
Listnation.selectedindex =-1;
Listnation.selectedvalue = "n090";

8. combobox--drop-down list

9, Datatimepicker--Date selection control
Set Check:
Datetimepicker1.value = Convert.todatetime (SJ);
Datetimepicker1.text = SJ;
Check value:
DateTimePicker1.Value.ToString ("yyyy mm month dd HH:mm:ss:ms")

10, PictureBox
Appearance, image can select a picture path
Behavior, SizeMode can set the picture size layout way

11, Imagelist
Imagelist1.images[n];

12, NotifyIcon

13, MenuStrip

14, ContextMenuStrip

15. tooltip--mouse move in the prompt box

16, ProgressBar--progress bar
Value to set the current progress of the progress bar

Events for Forms

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.