Board index » delphi » TPW - Disable CheckBox ??

TPW - Disable CheckBox ??

Hello,

does anyone know how to enable / disable a checkbox
in a dialog by a procedure of the dialog-object?
I know it's possible, the checkbox is drawn in grey
colour when disabled. It's also possible to have the
checkbox disabled in the Resource Workshop, but then
it is *always* disabled and that's not what I want.

Thanks in advance,

   Basti

--
-----------------------------------------------------------------------
       Bastisoft      101674.2...@compuserve.com

       Fleestedt, Germany
-----------------------------------------------------------------------

 

Re:TPW - Disable CheckBox ??


In article <4kr52i$...@dub-news-svc-1.compuserve.com>, 101674.2...@compuserve.com (Sebastian Koppehel) writes:

Quote

>Hello,

>does anyone know how to enable / disable a checkbox
>in a dialog by a procedure of the dialog-object?
>I know it's possible, the checkbox is drawn in grey
>colour when disabled. It's also possible to have the
>checkbox disabled in the Resource Workshop, but then
>it is *always* disabled and that's not what I want.

Try to play with EnableWindow or ShowWindow with the
window handle of your control.

  _____   Dominique LOVY, Dept. de Chimie-Physique, Universite  de  GENEVE
   /  /   30 Quai Ansermet, CH-1211 GENEVE 4 (Suisse)  l...@scsun.unige.ch
__/__/___ Tel: ++41 22 7026525  Fax: ++41 22 7026518

Re:TPW - Disable CheckBox ??


Quote
101674.2...@compuserve.com (Sebastian Koppehel) wrote:
> Hello,
> does anyone know how to enable / disable a checkbox
> in a dialog by a procedure of the dialog-object?
> I know it's possible, the checkbox is drawn in grey
> colour when disabled. It's also possible to have the
> checkbox disabled in the Resource Workshop, but then
> it is *always* disabled and that's not what I want.

To disable:
 EnableWindow(GetDlgItem(DlgWindowHandle,idofcontrol),FALSE);
To enable a disabled control/window, replace the FALSE with
a TRUE.

                       Mike

Re:TPW - Disable CheckBox ??


In article <4kr52i$...@dub-news-svc-1.compuserve.com>,
101674.2...@compuserve.com says...
Quote

>Hello,

>does anyone know how to enable / disable a checkbox
>in a dialog by a procedure of the dialog-object?
>I know it's possible, the checkbox is drawn in grey
>colour when disabled. It's also possible to have the
>checkbox disabled in the Resource Workshop, but then
>it is *always* disabled and that's not what I want.

>Thanks in advance,

>   Basti

>--
>----------------------------------------------------------------------
-
>       Bastisoft      101674.2...@compuserve.com

>       Fleestedt, Germany
>----------------------------------------------------------------------
-

>> Define your checkbox with style bs_3state. Then in setupwindow issue

a setcheck(2) to it to turn it gray.

- Show quoted text -

Quote
>> Martin

Re:TPW - Disable CheckBox ??


In article <4kr52i$...@dub-news-svc-1.compuserve.com>,
101674.2...@compuserve.com says...
Quote

>Hello,

>does anyone know how to enable / disable a checkbox
>in a dialog by a procedure of the dialog-object?
>I know it's possible, the checkbox is drawn in grey
>colour when disabled. It's also possible to have the
>checkbox disabled in the Resource Workshop, but then
>it is *always* disabled and that's not what I want.

>Thanks in advance,

>   Basti

>--
>----------------------------------------------------------------------
-
>       Bastisoft      101674.2...@compuserve.com

>       Fleestedt, Germany
>----------------------------------------------------------------------
-
>> Further to my previous answer on this subject, you need to turn off

bs_autocheckbox attribute as well as turning on bs_3state attribute in
your constructor procedure.
Martin

Other Threads