|
-
Mar 16th, 2002, 02:16 PM
#1
Thread Starter
Lively Member
PictureBox
hi,
I have a pictureBox and it contains few comboBoxes with lables, how can i loop thro all the ComboBoxes and Lables in the PictureBox?
I tried using the following code but it did not work..
Code:
Dim c As Control
For Each c In PictureBox.Controls
If TypeOf c Is ComboBox Then MsgBox "Comob"
If TypeOf c Is Label Then MsgBox "Label"
next c
Thanks
Manzoor
-
Mar 16th, 2002, 02:24 PM
#2
The picture isn't missing
use picturebox.parent instead of picturebox.controls.
Remember, if someone's post was not helpful, you can always rate their post negatively  .
-
Mar 16th, 2002, 02:27 PM
#3
PowerPoster
Check the container name:
VB Code:
Private Sub Command1_Click()
Dim c As Control
For Each c In Me
If c.Container.Name = "Picture1" Then
If TypeOf c Is ComboBox Then
MsgBox "Combobox in the picturebox: " & c.Name
End If
If TypeOf c Is Label Then
MsgBox "Label in the picturebox: " & c.Name
End If
End If
Next c
End Sub
-
Mar 17th, 2002, 12:19 AM
#4
Thread Starter
Lively Member
Originally posted by MidgetsBro
Check the container name:
VB Code:
Private Sub Command1_Click()
Dim c As Control
For Each c In Me
If c.Container.Name = "Picture1" Then
If TypeOf c Is ComboBox Then
MsgBox "Combobox in the picturebox: " & c.Name
End If
If TypeOf c Is Label Then
MsgBox "Label in the picturebox: " & c.Name
End If
End If
Next c
End Sub
Hey thanks all, MidgetsBro
it is working!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|