Tulkas Posted September 26, 2003 Posted September 26, 2003 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? Quote
*Experts* mutant Posted September 26, 2003 *Experts* Posted September 26, 2003 You dont seem to be adding the controls to the form: Me.Controls.Add(pbxSquarePic(xCount, yCount)) Quote
Tulkas Posted September 26, 2003 Author Posted September 26, 2003 =/ still has the same result as before Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.