dynamic pictureBox creation
-
Hi all, I have a form that contains one button and one textbox, the textbox will take a number that will be passed to another form. I have done this successfully. The thing is that I need the second form to create a number of pictureboxes = the number received from the first form. Any ideas?
-
Hi all, I have a form that contains one button and one textbox, the textbox will take a number that will be passed to another form. I have done this successfully. The thing is that I need the second form to create a number of pictureboxes = the number received from the first form. Any ideas?
If you are dealing with VB.Net the sample approach can give so some insight how to do that. But you should consider defining location, size, back color information for a specific picturebox which you get it from an array. The sample will rename the each picturebox automatically. :wtf:
Dim GetNumber as New Int32 = PutHereHowManyYouWant Dim I as Int32 For I = 1 to GetNumber Dim NewPicBox as New PictureBox NewPicBox.Name = "NewPicBox_" + I.toString NewPicBox.Size = New Size (PWidth(I), PHeight(I)) NewPicBox.Location = New Point (PX(I), PY(I)) NewPicBox.BackColor = color.From.ArgB(P1(I),P2(I),P3(I)) Me.Controls.Add(NewPicBox) 'Here you should create an addhandler and out eventhandler procedure to control each picture box. Next
What a curious mind needs to discover knowledge is noting else than a pin-hole.
-
If you are dealing with VB.Net the sample approach can give so some insight how to do that. But you should consider defining location, size, back color information for a specific picturebox which you get it from an array. The sample will rename the each picturebox automatically. :wtf:
Dim GetNumber as New Int32 = PutHereHowManyYouWant Dim I as Int32 For I = 1 to GetNumber Dim NewPicBox as New PictureBox NewPicBox.Name = "NewPicBox_" + I.toString NewPicBox.Size = New Size (PWidth(I), PHeight(I)) NewPicBox.Location = New Point (PX(I), PY(I)) NewPicBox.BackColor = color.From.ArgB(P1(I),P2(I),P3(I)) Me.Controls.Add(NewPicBox) 'Here you should create an addhandler and out eventhandler procedure to control each picture box. Next
What a curious mind needs to discover knowledge is noting else than a pin-hole.
hi JUNEYT actually I'm using C++.NET thanks anyway,
-
hi JUNEYT actually I'm using C++.NET thanks anyway,
Then ask in the Visual C++/CLI Forum[^].
Dave Kreskowiak Microsoft MVP - Visual Basic
-
Then ask in the Visual C++/CLI Forum[^].
Dave Kreskowiak Microsoft MVP - Visual Basic
ok, I will. Thanks all,