Checkbox backcolor ques

Checkbox backcolor ques

Anonymous
Not applicable
346 Views
4 Replies
Message 1 of 5

Checkbox backcolor ques

Anonymous
Not applicable
does a check box have to be disabled to be able to set the backcolor to
grey?

in this ex. ASBCheck is a check box and ASBCenteredCheck is a check box

Sub disable_asb()
''''''''''''''''''''''''''this doesn't work - why not?????
ASBCheck.BackColor = -2147483633
'but this does work
ASBCenteredCheck.Enabled = False
ASBCenteredCheck.BackColor = -2147483633
End Sub
I don't want to disable ASBCheck but I want to grey it out when this sub is
fired,
I want to later be able to hit ASBCheck and have it call enable_asb

Also, I see the colors in the properties box spelled like &H8000000F& but
when I put that in a sub i get an error
Is there a chart of color numbers in the help files somewhere? I've looked
but cant find it.
Also is there somewhere in the help that has info like the above question -
I may be looking in the wrong place, I just haven't found hardly anything on
form controls and have therefore been wasting bandwidth with my lame
questions for the last couple days. I'm afraid I'm going to wear out my
welcome here.

Thanks for any help
Mark
0 Likes
347 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable
The number you enter isn't a matching color... Try VbRed, or VbGrey or if
you do want to enter a number try this:

ChkBox.BackColor = &H8000000F

This will set the color to grey.

Joeri Tuyn




"MP" wrote in message
news:D80CADE70527456C2E1CB576D5B6155C@in.WebX.maYIadrTaRb...
> does a check box have to be disabled to be able to set the backcolor to
> grey?
>
> in this ex. ASBCheck is a check box and ASBCenteredCheck is a check box
>
> Sub disable_asb()
> ''''''''''''''''''''''''''this doesn't work - why not?????
> ASBCheck.BackColor = -2147483633
> 'but this does work
> ASBCenteredCheck.Enabled = False
> ASBCenteredCheck.BackColor = -2147483633
> End Sub
> I don't want to disable ASBCheck but I want to grey it out when this sub
is
> fired,
> I want to later be able to hit ASBCheck and have it call enable_asb
>
> Also, I see the colors in the properties box spelled like &H8000000F& but
> when I put that in a sub i get an error
> Is there a chart of color numbers in the help files somewhere? I've looked
> but cant find it.
> Also is there somewhere in the help that has info like the above
question -
> I may be looking in the wrong place, I just haven't found hardly anything
on
> form controls and have therefore been wasting bandwidth with my lame
> questions for the last couple days. I'm afraid I'm going to wear out my
> welcome here.
>
> Thanks for any help
> Mark
>
>
0 Likes
Message 3 of 5

Anonymous
Not applicable
Joeri Tuyn wrote in message
news:80B84AC74D412C9226AE0C6BBF42B77E@in.WebX.maYIadrTaRb...
> The number you enter isn't a matching color... Try VbRed, or VbGrey or if
> you do want to enter a number try this:
>
> ChkBox.BackColor = &H8000000F
>
> This will set the color to grey.
>
> Joeri Tuyn
Hi Joeri,
Thanks for responding.
Are you possibly working in VB? I'm in VBA at the moment and I get compile
error variable not defined with this line:
Const ColorOff = vbgrey
'and the same error with
Dim coloroff As Long
coloroff = vbgrey

'however all of these work fine
Const ColorOn = -2147483643
Const ColorOff = -2147483633
Const ColorOff = &H8000000F

'this is being called like
ChkBox.BackColor = ColorOff

what I found was that a checkbox or option button has to be disabled before
the background can be set to grey.
whereas a textbox can have a grey background and still be enabled. Don't
know why that is, and I wouldn't mind being able to grey a checkbox when
it's unchecked but still enabled but hey, I can't have everything. :-)~

Thanks for the help
Mark
0 Likes
Message 4 of 5

Anonymous
Not applicable
try vbgray with an "a"

"MP" wrote in message
news:3D55F293FA61924549BE0CABE709DF4D@in.WebX.maYIadrTaRb...
>
> Joeri Tuyn wrote in message
> news:80B84AC74D412C9226AE0C6BBF42B77E@in.WebX.maYIadrTaRb...
> > The number you enter isn't a matching color... Try VbRed, or VbGrey or
if
> > you do want to enter a number try this:
> >
> > ChkBox.BackColor = &H8000000F
> >
> > This will set the color to grey.
> >
> > Joeri Tuyn
> Hi Joeri,
> Thanks for responding.
> Are you possibly working in VB? I'm in VBA at the moment and I get compile
> error variable not defined with this line:
> Const ColorOff = vbgrey
> 'and the same error with
> Dim coloroff As Long
> coloroff = vbgrey
>
> 'however all of these work fine
> Const ColorOn = -2147483643
> Const ColorOff = -2147483633
> Const ColorOff = &H8000000F
>
> 'this is being called like
> ChkBox.BackColor = ColorOff
>
> what I found was that a checkbox or option button has to be disabled
before
> the background can be set to grey.
> whereas a textbox can have a grey background and still be enabled. Don't
> know why that is, and I wouldn't mind being able to grey a checkbox when
> it's unchecked but still enabled but hey, I can't have everything. :-)~
>
> Thanks for the help
> Mark
>
>
0 Likes
Message 5 of 5

Anonymous
Not applicable
Glen Albert wrote in message
news:5014407564D6CE722CCC0BE89B40FBB2@in.WebX.maYIadrTaRb...
> try vbgray with an "a"
Glen,
Maybe my machine is worn out. I get variable undefined with VBGray and also
with VBGrey.
using an integer works however. as does the weird &H thing - what's up with
that anyway? Is that a hex number or a reference to a memory location?
thanks.
Mark
0 Likes