Connecting Tech Pros Worldwide Help | Site Map

Check Box Greyed

EdB
Guest
 
Posts: n/a
#1: Nov 21 '05
In VB6, you could set a check box to checked, unchecked, or greyed. The
latter would be used to show a setting but disable the control.

In .Net, the third choice is not greyed, but indeterminate. And the doc
says it shows it as greyed, but checked. So how do you show greyed and
unchecked?

Disabling the control in total greys out the control's text which is less
than desirable.
Matt
Guest
 
Posts: n/a
#2: Nov 21 '05

re: Check Box Greyed


Ed,

To grey it out, mark Enabled as False.
To check/uncheck, change Checked as needed. Unchecked is False.

Good luck,
Matt

"EdB" <EdB@discussions.microsoft.com> wrote in message
news:06BE243B-83FA-40D0-BF5C-C60C955335B7@microsoft.com...[color=blue]
> In VB6, you could set a check box to checked, unchecked, or greyed. The
> latter would be used to show a setting but disable the control.
>
> In .Net, the third choice is not greyed, but indeterminate. And the doc
> says it shows it as greyed, but checked. So how do you show greyed and
> unchecked?
>
> Disabling the control in total greys out the control's text which is less
> than desirable.[/color]


Herfried K. Wagner [MVP]
Guest
 
Posts: n/a
#3: Nov 21 '05

re: Check Box Greyed


"EdB" <EdB@discussions.microsoft.com> schrieb:[color=blue]
> In VB6, you could set a check box to checked, unchecked, or greyed. The
> latter would be used to show a setting but disable the control.
>
> In .Net, the third choice is not greyed, but indeterminate. And the doc
> says it shows it as greyed, but checked. So how do you show greyed and
> unchecked?[/color]

Set the control's 'TreeState' property to 'True'.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
EdB
Guest
 
Posts: n/a
#4: Nov 21 '05

re: Check Box Greyed


As I stated below......if I follow this approach, the text next to the check
box will be "disabled" as well. That is not the answer I am looking for.

"Matt" wrote:
[color=blue]
> Ed,
>
> To grey it out, mark Enabled as False.
> To check/uncheck, change Checked as needed. Unchecked is False.
>
> Good luck,
> Matt
>
> "EdB" <EdB@discussions.microsoft.com> wrote in message
> news:06BE243B-83FA-40D0-BF5C-C60C955335B7@microsoft.com...[color=green]
> > In VB6, you could set a check box to checked, unchecked, or greyed. The
> > latter would be used to show a setting but disable the control.
> >
> > In .Net, the third choice is not greyed, but indeterminate. And the doc
> > says it shows it as greyed, but checked. So how do you show greyed and
> > unchecked?
> >
> > Disabling the control in total greys out the control's text which is less
> > than desirable.[/color]
>
>
>[/color]
Herfried K. Wagner [MVP]
Guest
 
Posts: n/a
#5: Nov 21 '05

re: Check Box Greyed


"Matt" <mrocha@camicro.com> schrieb:[color=blue]
> To grey it out, mark Enabled as False.
> To check/uncheck, change Checked as needed. Unchecked is False.[/color]

The OP wrote that disabling is not an option:

| Disabling the control in total greys out the control's text which is less
| than desirable

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

EdB
Guest
 
Posts: n/a
#6: Nov 21 '05

re: Check Box Greyed


OK, I gathered that that had something to do with it, but I am still not clear.

Can you give me a quick code example that shows the checkbox as checked,
then unchecked with the user locked out from manipulating it?

"Herfried K. Wagner [MVP]" wrote:
[color=blue]
> "EdB" <EdB@discussions.microsoft.com> schrieb:[color=green]
> > In VB6, you could set a check box to checked, unchecked, or greyed. The
> > latter would be used to show a setting but disable the control.
> >
> > In .Net, the third choice is not greyed, but indeterminate. And the doc
> > says it shows it as greyed, but checked. So how do you show greyed and
> > unchecked?[/color]
>
> Set the control's 'TreeState' property to 'True'.
>
> --
> M S Herfried K. Wagner
> M V P <URL:http://dotnet.mvps.org/>
> V B <URL:http://classicvb.org/petition/>
>[/color]
Herfried K. Wagner [MVP]
Guest
 
Posts: n/a
#7: Nov 21 '05

re: Check Box Greyed


"EdB" <EdB@discussions.microsoft.com> schrieb:[color=blue]
> Can you give me a quick code example that shows the checkbox as checked,
> then unchecked with the user locked out from manipulating it?[/color]

It seems that I misunderstood your post too. You can archieve the desired
behavior by setting the checkbox' 'AutoCheck' property to 'False'.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

EdB
Guest
 
Posts: n/a
#8: Nov 21 '05

re: Check Box Greyed


"Herfried K. Wagner [MVP]" wrote:
setting the checkbox' 'AutoCheck' property to 'False'.

We're getting closer I think, but this is still not the behavior I am truly
after.

I have a business object. The user pulls the record up for editing. A
particular bit field may be viewed but not edited.

Auto check will prevent them from changing the state of the control, but the
fact that box itself is not greyed is not intuitive to the user......they
will wonder why they are clicking in the box and nothing is happening.

As I said, in VB6 you could grey the checkbox and have the text associated
with the checkbox displayed normally. That's what I'm after.
Dennis
Guest
 
Posts: n/a
#9: Nov 21 '05

re: Check Box Greyed


I would use two controls, a checkbox with no text and a label beside it with
the text. You can then enable/disable the checkbox to grey it out and the
label won't be greyed!

"EdB" wrote:
[color=blue]
> "Herfried K. Wagner [MVP]" wrote:
> setting the checkbox' 'AutoCheck' property to 'False'.
>
> We're getting closer I think, but this is still not the behavior I am truly
> after.
>
> I have a business object. The user pulls the record up for editing. A
> particular bit field may be viewed but not edited.
>
> Auto check will prevent them from changing the state of the control, but the
> fact that box itself is not greyed is not intuitive to the user......they
> will wonder why they are clicking in the box and nothing is happening.
>
> As I said, in VB6 you could grey the checkbox and have the text associated
> with the checkbox displayed normally. That's what I'm after.[/color]
Closed Thread