Winfrom Controls-Basic tools

Source: Internet
Author: User

Form events: Properties-Event-load (double-click Add)

Events after the form has finished loading:

Delete Event: The event name in the property event is deleted (load in action) and the event in the background code is deleted.

CONTROLS: Toolbox (Search-double-click or drag to form interface)

1. label--Text Display tool

Properties: Text: Display text (font, ForeColor These properties can be used, change font, etc.)

Each control or tool has a name and is not allowed to repeat, set name: Biaoti.

What to write in the background code:

2, textbox--text box (allow user input) and lable the same

3. richtextbox--Text field (multi-line) (same as 2)

4, button--button (the appearance of the FlatStyle can be designed,) its function: Click on it can achieve certain functions,--click the event (add: Double-click button)

5, RadioButton (usually two or more)--radio button

Checked property: Whether to select (the default check) to group in the same parent set.

panel--is a container (can be said to put things)

A: Remove the radio button check value

Each tool has an object, and each type of tool is a class, and the From1 is an object, and all of the tools have a control,

is: To determine whether this object belongs to this class as: conversion type

B: Set a default check for an item

C: Do not use the mouse to drag the tool code write

Columns such as: Put a label inside the panel

6. CheckBox (same as ditto)

Can be set to select all:

If you store a code name (GCA in the "Han" "hui" each deposit Code: N001,N002)

Attribute--Data--tag (write code) TAG: can store custom data

Then the value is:

MessageBox.Show (CK. Tag.tostring ()); need to convert

7. listbox--list Box

Add 1: Add with Mouse (properties--data--items)

Add 2: Typically read from the database to the data and then display it in the list

1, first change the name of listnation (Check Nation table)

Use the data in the database to read the database: three major categories (after writing well)

A: Show data:

The result is that the listbox is bound to a value:

B1: Takes the value of the selected item:

B2: Take the value shown in the selected item:

There are differences between ListBox and ComboBox: 1, display different 2, drop-down list can only choose one at a time, the listbox can sometimes choose multiple properties--behavior--selectionmode can be modified

If multiple re-check values are selected:

C: Set a selected

8. combobox--drop-down list (same as ListBox, but not multiple)

9. datetimepicker--Date Selection Control

A: Set which day to select

Results:

B: Take the date that is selected inside


private void Button9_click (object sender, EventArgs e)
{
String sj= "2016-1-1";//Set selected

Check values: The following two ways

Datetimepicker1.value = Convert.todatetime (SJ);//Desirable values can also be assigned
Datetimepicker1.text = SJ;
}

Winfrom Controls-Basic tools

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.