|
-
Mar 28th, 2000, 11:58 AM
#1
Thread Starter
New Member
I need to have some type of variable that will set the backcolor of command buttons. This color will be selected on my main form but needs to be used on all of my forms, is there a way to store for example: vbblue = variable from my startup form and have it seen by all the forms.
-
Mar 28th, 2000, 12:03 PM
#2
Hyperactive Member
Not exactly.
Something like 'vbblue' is what is called an "Enumerated Type". This means that 'vbblue' is actually a CONSTANT and that means it is fixed throughout and can not be changed dynamically (ie when you are running your application).
What you need to do is simply create a global variable to contain the color and then during the Form_Load event for each and every form you have you need to go through each of the command buttons and set that color.
Its frustrating but thats just the nature of the beast
-
Mar 28th, 2000, 12:06 PM
#3
Thread Starter
New Member
How do I set a Global Variable:
Dim CommandColor as String did not work
-
Mar 28th, 2000, 12:24 PM
#4
Hyperactive Member
If you only have 1 form then you can do it at the top of that form... if you have more than one then you have to do it in a Module (Go to add to your VB project but select Module instead of Form)
Code:
Global CommandColor as String
-
Mar 28th, 2000, 02:36 PM
#5
transcendental analytic
I think colors are stored in a Long data type.
-
Mar 28th, 2000, 03:18 PM
#6
Hyperactive Member
I'm sure colours are stored as longs.
You can also try declaring a public var As OLE-COLOR.
That's the way usercontrol-colour-properties are declared.
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
|