Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

controls inside a frame question 1

Status
Not open for further replies.

Fursten

Programmer
Dec 27, 2000
403
PT
Hi,

Is there any simple way to access the controls inside a container, like a Frame?

The goal is to change the properties of textboxes inside a frame withou need to write each of them manualy, but by using: for each ctrl in Frame .... next

Thank you

Sergio Oliveira
 
Hi Sergio

There are two ways of doing this.
The First is:
If you want to use frames as the container you cannot access the controls painted on them like

Frame1.Controls

But what you can do is to access all the controls on the form and check if that control's container is frame1 e.g

Dim mycntr As Control
For Each mycntr In UserControl11.Controls
if mycntr.Name = "Frame1" then
msgbox "Hallo Control On The Frame I'am Looking For"
endif
Next



The Second is:
To Create and Usercontrol and set the ControlContainer Property To True.
Add your own Controls Property e.g
Property Get Controls() As Object
Set Controls = UserControl.ContainedControls
End Property

If you want me to mail you a little demo project just email me at cdt@icon.co.za and I will mail it to you

Cheers
Toyman
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top