SheepDip
asked on
VB Items in a Frame
Hi.
Is there a way to change a common property at runtime for all the items in a frame or form?
i.e.
For each THING in thisFORM
THING.BackColor = vbWhite
Next THING
OR for a Frame?
Cheers
Sheepie
Is there a way to change a common property at runtime for all the items in a frame or form?
i.e.
For each THING in thisFORM
THING.BackColor = vbWhite
Next THING
OR for a Frame?
Cheers
Sheepie
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
To know the control type , you can use : typeof
i.e.
For Each ctrl In Me.Controls
if typeof ctrl is textbox then ' say
ctrl.BackColor = vbRed
endif
Next
Kapil
i.e.
For Each ctrl In Me.Controls
if typeof ctrl is textbox then ' say
ctrl.BackColor = vbRed
endif
Next
Kapil
ASKER
Kept getting an error as certain objects did not have the backcolor property (and i couldn't be arsed finding out which ones - there are a lot). So dropped in the dreaded catch all on error resume next.
For Each ctrlA In frmTicket.Controls ' Change ticket colour = SELL
On Error Resume Next
ctrlA.BackColor = &HC0C0FF
Next ctrlA
On error goto 0
cheers again
SD