{"id":25,"date":"2008-12-01T07:38:10","date_gmt":"2008-11-30T23:38:10","guid":{"rendered":"http:\/\/karyleong.net\/?p=25"},"modified":"2008-12-01T07:41:52","modified_gmt":"2008-11-30T23:41:52","slug":"create-control-array-in-visual-baisc-2005-2008","status":"publish","type":"post","link":"https:\/\/karyleong.net\/?p=25","title":{"rendered":"Create Control Array in Visual Baisc 2005 &#038; 2008"},"content":{"rendered":"<pre>Public Class Form1\r\n\r\n    Dim MyPictureBoxes() As PictureBox\r\n\r\n    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load\r\n        ReDim MyPictureBoxes(29)\r\n        Dim i As Integer\r\n        For i = 0 To UBound(MyPictureBoxes)\r\n            MyPictureBoxes(i) = New PictureBox\r\n            Me.Controls.Add(MyPictureBoxes(i))\r\n            With MyPictureBoxes(i)\r\n                .Visible = False\r\n                .BorderStyle = BorderStyle.Fixed3D\r\n                .Name = \"MyPicterbox \" &amp; i.ToString\r\n                'U'll have to set the location and other property's...\r\n                'Also if u want the events of the picturenbox to fire u'll need to add an \"addhandler\" like the one iam using for this example.\r\n                AddHandler MyPictureBoxes(i).MouseClick, AddressOf MyPictureBoxesMouseClick\r\n            End With\r\n        Next\r\n    End Sub\r\n\r\n    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click\r\n\r\n        MyPictureBoxes(1).Visible = True\r\n    End Sub\r\n\r\n    Private Sub MyPictureBoxesMouseClick(ByVal sender As System.Object, ByVal e As System.EventArgs)\r\n\r\n        Dim Pb As PictureBox\r\n        Pb = CType(sender, PictureBox)\r\n        MsgBox(Pb.Name.ToString &amp; \" was clicked \")\r\n\r\n    End Sub\r\n\r\nEnd Class<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Public Class Form1 Dim MyPictureBoxes() As PictureBox Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ReDim MyPictureBoxes(29) Dim i As Integer For i = 0 To UBound(MyPictureBoxes) MyPictureBoxes(i) = New PictureBox Me.Controls.Add(MyPictureBoxes(i)) With MyPictureBoxes(i) .Visible = False .BorderStyle = BorderStyle.Fixed3D .Name = &#8220;MyPicterbox &#8221; &amp; i.ToString &#8216;U&#8217;ll have to set the &#8230; <a title=\"Create Control Array in Visual Baisc 2005 &#038; 2008\" class=\"read-more\" href=\"https:\/\/karyleong.net\/?p=25\" aria-label=\"More on Create Control Array in Visual Baisc 2005 &#038; 2008\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[9],"tags":[11,12,10],"_links":{"self":[{"href":"https:\/\/karyleong.net\/index.php?rest_route=\/wp\/v2\/posts\/25"}],"collection":[{"href":"https:\/\/karyleong.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/karyleong.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/karyleong.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/karyleong.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=25"}],"version-history":[{"count":3,"href":"https:\/\/karyleong.net\/index.php?rest_route=\/wp\/v2\/posts\/25\/revisions"}],"predecessor-version":[{"id":27,"href":"https:\/\/karyleong.net\/index.php?rest_route=\/wp\/v2\/posts\/25\/revisions\/27"}],"wp:attachment":[{"href":"https:\/\/karyleong.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=25"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/karyleong.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=25"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/karyleong.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=25"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}