For example:
1, put a FlowLayoutPanel Form1
2, to build a Form2, inside put some controls, such as put a PictureBox
Mr Khoja 4, according to the data of dynamic loading Form2 into FlowLayoutPanel data, a data to generate a Form2.
I can now in the final interface to realize right click on the "display images", window click on the images, I want to click a button: display all pictures, let loading out of the window display images at the same time, could you tell me the how to implement,
Thank you very much!
CodePudding user response:
Form1 add:Private void button1_Click (object sender, EventArgs e)
{
Form2 f2=new Form2 (pictureBox1. Image);
F2. The Show ();
}
Add form2
Public Form2 Image (b)
{
InitializeComponent ();
PictureBox1. Image=b;
}
CodePudding user response:
CodePudding user response:
NiuRan, after you this is click on the create a window for many times, at the same time give each window image data, and display! My demand is that open the f1, creates multiple f2, at the same time in order to seek speed, the default is not loading pictures, just preach the procession of associated data! I just give id f2 pass, for example, needs to be loaded image, the image data obtained by id again again!!! I can realize separate one by one, according to what I want to consulting is how to button, click the f1 or f2 brought on a widget, as long as one click all f2 display picture! afterCodePudding user response:
Two wayThe first: create a event method such as
Protect void xxxClick (object sender, EventArgs e)
{
//todo
}
Then select what do you want to register event controls right-click properties have a lightning symbol to choose you to register the events and then choose your method can
The second:
In the constructor of all you want to register the events with +=followed by your name, but requires entrusted by the input and output parameters
CodePudding user response:
Like this?CodePudding user response: