Now I want to add the number of picture boxes to windows form dynamically. for eg. when user put the input in text box such as user enter 4 then Four picture boxes are added to the form at run time.
also I don't know how handle the context menu event also at run time for the above picture boxes in win form............
prit005
0
Light Poster
Recommended Answers
Jump to Posttry:
PictureBox[] pbs; void textBox1_TextChanged(object sender, EventArgs) { int num =0; if(int.TryParse(textBox1.Text, out num)) { pbs = new PictureBox[num]; int x = 20, y = 20; for(int i = 0; i < pbs.Lenght; i++) { pbs[i] = new PictureBox(); pbs[i].Name = "pictureBox" + (i + 1); pbs[i].Location …
All 3 Replies
Mitja Bonca
557
Nearly a Posting Maven
prit005
0
Light Poster
Mitja Bonca
557
Nearly a Posting Maven
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.