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