Picturebox

PianoMan
01-06-2005, 10:03 AM
I've got an arrayof Pictureboxes. Is there a way to tell if say, Picturebox1(5) contains a picture?

I've got a program where the user clicks on a Label, and the name on the Label gets transferred to a Textbox (array). I have it check to see if txtName(Index).Text = "". If so, then it fills in that TextBox. If not, then it increases the Index by 1, checks again until it finds an empty one, and fills in the TextBoxes. Then they click on another label, and a Picture from an ImageList gets transferred to a picturebox. Since the image has to correspond to the name, I need to do the same thing as I did with the TextBox: check to find the first available PictureBox and put the picture there. The code for the Textbox is this:

Private Sub lblName_Click(Index As Integer)
Static I As Integer

If txtName(I).Text = "" Then
I = txtName(I).Index
Else
I = txtName(I).Index + 1
End If

txtName(I).Text = lblName.Item(Index).Caption
txtStart(I).SetFocus
lblSkill(I).Caption = lblEmpSkill(I).Caption
End Sub

I'm just stuck on how to see if the PictureBox already contains a picture.

Verphix
01-06-2005, 10:06 AM
You could use:
If Picture1(5).Picture = 0 then 'if it doesn't contain a picture
'do blah
end if

PianoMan
01-06-2005, 10:23 AM
Thank you! That's what I needed. Works great.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum