WinForm User Form

Source: Internet
Author: User

User controls:

The equivalent of a custom panel can be placed in a variety of other controls, and in the background can call the entire custom control.

Usage: Right-click on an item, add, user control, and then edit the user control to resemble a normal container control. If you want to add to the form in the background,

Instantiate it, and then add it to the control collection of the container you want to add.

To create the add control dynamically:

With the above user control, to implement a similar QQ interface to open the automatic load friend nickname and signature

Name Na =NULL;  PublicForm2 (Name na) {InitializeComponent (); Na=na; //Populating user InformationPanel2. BackgroundImage =Image.FromFile (na.pic); Label1. Text=na.name1; Label2. Text=Na.nickname; //Populate friend InformationFriend f =NewFridendcode (). Seleaf (NA.            number); if(F! =NULL)            {                string[] ff = F.friendsnumber.split (','); foreach(stringFffinchFF) {Name NF=NewNamecode ().                    Seleall (FFF); if(NF! =NULL) {UserControl1 v1=NewUserControl1 (); V1.panel1.BackgroundImage=Image.FromFile (NF.                        PIC); V1.label1.Text=NF.                        Name1; V1.label2.Text=NF.                        Nickname;                    FLOWLAYOUTPANEL1.CONTROLS.ADD (v1); }                }            }        }

WinForm User Form

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.