Disabling checkbox
-
Does anyone know how to disable a checkbox without disabling its text? I want the box disabled but the text to be normal. Basically so it looks like a regular checkbox you have no control over. -dork
I would just introduce an internal flag which indicates if the checkbox is disabled or not. Then implement a callback function which gets called when the state of the checkbox changes. UpdateData(TRUE). If the checkbox flag indicates disabled, invert the current state, else not. :-D -Dominik
_outp(0x64, 0xAD);
and__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do?? ;) -
Does anyone know how to disable a checkbox without disabling its text? I want the box disabled but the text to be normal. Basically so it looks like a regular checkbox you have no control over. -dork
You can derive class from CButton. In your derived class, provide a function in which u create a static control and places it just over the text area of your check box. Use GetWindowText or any other function to get combo box text. Provide your own function for enabling and disabling in which after calling base class implementation, redraw static control. i hope that works. Muhammad Shoaib Khan http://geocities.com/lansolution
-
I would just introduce an internal flag which indicates if the checkbox is disabled or not. Then implement a callback function which gets called when the state of the checkbox changes. UpdateData(TRUE). If the checkbox flag indicates disabled, invert the current state, else not. :-D -Dominik
_outp(0x64, 0xAD);
and__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do?? ;)Dominik Reichl wrote: If the checkbox flag indicates disabled, invert the current state, else not. this would enable the checkbox if it is disabled. this is not what he wants. he wants that check box is disabled but its text appears as enabled i.e checkbox is no longer able to respond to user but its text appears as enabled. Muhammad Shoaib Khan http://geocities.com/lansolution
-
Dominik Reichl wrote: If the checkbox flag indicates disabled, invert the current state, else not. this would enable the checkbox if it is disabled. this is not what he wants. he wants that check box is disabled but its text appears as enabled i.e checkbox is no longer able to respond to user but its text appears as enabled. Muhammad Shoaib Khan http://geocities.com/lansolution
M.Shoaib Khan wrote: this would enable the checkbox if it is disabled. Nope. You make a call to the UpdateData(TRUE) function. Therefor the member variable for the checkbox contains the _new_ state of the checkbox. If you want to ignore the change, you therefor have to invert the state now. :-D -Dominik
_outp(0x64, 0xAD);
and__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do?? ;)