Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

In the Form_Load event I have the following code:

       ' --- Begin creation of checker pics
       Dim pbxSquarePic(7, 7) As PictureBox   'Create array of checkers

       Dim xCount As Integer
       Dim yCount As Integer

       xCount = 0
       yCount = 0

       'Position and set starting properties of SquarePic
       Do While yCount <= 7
           Do While xCount <= 7
               pbxSquarePic(xCount, yCount) = New PictureBox
               pbxSquarePic(xCount, yCount) = pbxSample
               pbxSquarePic(xCount, yCount).Left = xCount * 75 + 76
               pbxSquarePic(xCount, yCount).Top = yCount * 75 + 76
               pbxSquarePic(xCount, yCount).Refresh()
               xCount = xCount + 1
           Loop
           yCount = yCount + 1
           xCount = 0
       Loop


       ' --- End creation of checker pics

 

pbxSample is a picbox created during design time

 

Here's what is happening...

 

Only 1 pbox is showing - pbxSquarePic(7,7) but is exactly where it should be and has the right properties.

None of the pics showed until I set all of them to pbxSample first.

 

Here's what I have tried to fix it...

 

Using Me.Refresh to refresh the form at the end of the Form_Load event.

Checking using Debug statements to see that indeed all pboxes exist and are where they should be.

Making sure the Visible property of each pic is True.

 

Could someone tell me what I am doing or not doing?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...