-
May 1st, 2009, 11:53 AM
#1
Passing control name to sub
I need to pass the name of a control to a procedure to change the color...but this does not seem to work...any thoughts?
Dim CTRL As Control
For Each CTRL In Controls
If TypeOf CTRL Is Label Then CTRL.BackColor = TheColor
If TypeOf CTRL Is Frame Then CTRL.BackColor = TheColor
If TypeOf CTRL Is OptionButton then ReviseColor (CTRL)
If TypeOf CTRL Is Slider Then CTRL.BackColor = TheColor
If TypeOf CTRL Is CheckBox Then CTRL.BackColor = TheColor
Next CTRL
.......
ReviseColor (CTRL as Control)
CTRL.BackColor = VbRED
...more processing
....more processing
end sub
this revise color subroutine does nothing...what's wrong?
Tags for this Thread
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
|