|
-
Feb 7th, 2007, 07:18 AM
#1
Thread Starter
Hyperactive Member
Change all properties at once
Hi
How can I change all object properties of my form with one command,I know there's a way and it's easy but I can't remember it...
For example I have a few text boxex, commands buttons, labels...and I want to set their background color with one line of code...
How do I do this ?!
Thankyou
Horazio
-
Feb 7th, 2007, 07:57 AM
#2
Hyperactive Member
Re: Change all properties at once
Hi ! Here it's what I use
VB Code:
On Error Resume Next
For Each objControl In frMain.Controls
With objControl
If TypeOf objControl Is TextBox Then
.BackColor = vbWhite
End If
End With
Next
I hope this code will help !
DubweiserTM

If your question has been answered, you can mark a thread as resolved...
-
Feb 7th, 2007, 11:47 AM
#3
Thread Starter
Hyperactive Member
Re: Change all properties at once
..and what about this, is it possible ?!?
On Error Resume Next
For Each objControl In frMain.Controls
.BackColor = vbWhite
Next
-
Feb 7th, 2007, 12:16 PM
#4
Re: Change all properties at once
You would need to stipulate your object variable name
VB Code:
On Error Resume Next
For Each objControl In frMain.Controls
objControl.BackColor = vbWhite
Next
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
|