How to grey all the controlsin a dialog box? 
Author Message
 How to grey all the controlsin a dialog box?

Sorry to all, I have not finish asking my question yet. Here is a more
detail version of it.

I have a dialog box that has all its control enabled ( i.e. not greyed)
and popout when clicked on Menu Item B, when Menu Item A is not clicked
on. When Menu Item A is clicked on, the dialog box still pop out upon
clicking Menu Item B but with all its control greyed.
In other words, if i have an edit box (IDC_EDIT) in the dialog box,
greying it will not clear the initial text in the edit box, it just
become ineditable.

What i have thought of is to get individual pointer to point at everyone
of the control in the dialog box as shown belown. But i find that this
is a rather inefficient way since I have quite a number of control in
the dialog box.

Can someone please enlighten me. As I have mention in my previous
message, is there anything to do with OLE?? I try to read up about OLE,
but I am still not sure about it.

Thanks in advance. Please e-mail me in addition to the NewsGroup.
leesze....
A.h
class A:
{
    ......
static BOOL clicked;
.....

Quote:
}

A.Cpp
....
BOOL A::clicked = TRUE;
......
void OnUpdateItemA(CCmdUI* pCmdUI)
{
......
//if clicked on
A::clicked = !A::clicked;
.....

Quote:
}

B.Cpp
.....
void OnUpdateItemB(CCmdUI* pCmdUI)
{

    ......
CEdit *ceptr = (CEdit*) GetDlgItem(IDC_EDIT)
pCmdUI->EnableWindow (!(A::clicked = = FALSE))
....

Quote:
}



Sun, 30 Sep 2001 03:00:00 GMT  
 How to grey all the controlsin a dialog box?
Hiya!

try using

SendMessageToDescendants(WM_ENABLE,(WPARAM)(A::clicked?FALSE:TRUE));

in B::OnInitDialog()

Rob



Sorry to all, I have not finish asking my question yet. Here is a more
detail version of it.
I have a dialog box that has all its control enabled ( i.e. not greyed) and
popout when clicked on Menu Item B, when Menu Item A is not clicked on. When
Menu Item A is clicked on, the dialog box still pop out upon clicking Menu
Item B but with all its control greyed.
In other words, if i have an edit box (IDC_EDIT) in the dialog box, greying
it will not clear the initial text in the edit box, it just become
ineditable.
What i have thought of is to get individual pointer to point at everyone of
the control in the dialog box as shown belown. But i find that this is a
rather inefficient way since I have quite a number of control in the dialog
box.
Can someone please enlighten me. As I have mention in my previous message,
is there anything to do with OLE?? I try to read up about OLE, but I am
still not sure about it.
Thanks in advance. Please e-mail me in addition to the NewsGroup.
leesze....
A.h
class A:
{
    ......
static BOOL clicked;
.....

Quote:
}

A.Cpp
....
BOOL A::clicked = TRUE;
......
void OnUpdateItemA(CCmdUI* pCmdUI)
{
......
//if clicked on
A::clicked = !A::clicked;
.....
Quote:
}

B.Cpp
.....
void OnUpdateItemB(CCmdUI* pCmdUI)
{
    ......
CEdit *ceptr = (CEdit*) GetDlgItem(IDC_EDIT)
pCmdUI->EnableWindow (!(A::clicked = = FALSE))
....
Quote:
}



Mon, 01 Oct 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. How do I get grey dialog box backgrounds?

2. Function to disable or grey out Edit Box

3. Edit box: Not grey when read only?

4. SetDialogBkColor colors dialog but MessageBox is grey

5. Modeless dialog box together with modal dialog box

6. activating a button on a dialog box from a dialog box

7. Dialog box in a dialog box

8. transfer data from one dialog box to another dialog box

9. PBM: Message box not displayed after main dialog box is closed in MFC dialog-based app

10. set an arbitrary printer driver in print dialog box without showing the print dialog box

11. how to set an arbitrary printer driver in print dialog box without showing the dialog box

12. Transfer of data from an edit box in one dialog box to a list box in another dialog box II

 

 
Powered by phpBB® Forum Software