I have several picture boxes in a form. Each picture box contains some controls (mostly labels and textboxes). How can I do some operation to those controls in a CERTAIN PICTURE BOX? For example, if I want to change the backcolor of all textboxes in picutebox#2 ONLY. I know the method:
Dim varCtrl as Controls
For Each varCtrl in Controls
...(check if it is a textbox, if yes then perform operations)
Next
But this trick is not useful here because it will change the backcolor of ALL textboxes in ALL pictureboxes in this form. So I tried
For Each varCtrl in Picbox2
...(operations)
Next
results in error.I also tried
For Each varCtrl in Controls
If varCtrl.Parent = Picbox2 then
...(operations)
End If
Next
error again.
Please help!
Dim varCtrl as Controls
For Each varCtrl in Controls
...(check if it is a textbox, if yes then perform operations)
Next
But this trick is not useful here because it will change the backcolor of ALL textboxes in ALL pictureboxes in this form. So I tried
For Each varCtrl in Picbox2
...(operations)
Next
results in error.I also tried
For Each varCtrl in Controls
If varCtrl.Parent = Picbox2 then
...(operations)
End If
Next
error again.
Please help!