Window Caption for a Dialog Box Control 
Author Message
 Window Caption for a Dialog Box Control

I need a caption on a Dialog Control (such as a list box etc)

WS_CAPTION for control window seems to be ignored.

A border is created but no caption.

Any ideas how to get this to work ?



Mon, 11 Nov 2002 03:00:00 GMT  
 Window Caption for a Dialog Box Control
As far as I know, you will need to just put a static text box beside the
control in question.(Except CButton).

Keith

Quote:
> I need a caption on a Dialog Control (such as a list box etc)

> WS_CAPTION for control window seems to be ignored.

> A border is created but no caption.

> Any ideas how to get this to work ?



Mon, 11 Nov 2002 03:00:00 GMT  
 Window Caption for a Dialog Box Control
Hi..
        You can try

            ModifyStyle(0,WS_CAPTION , SWP_DRAWFRAME)

        For example if you have an edit box, then calling

            (CEdit*)GetDlgItem(IDC_EDIT1 )->ModifyStyle(0,WS_CAPTION ,
SWP_DRAWFRAME) ;

        will add a caption. However note that you should extend the size, to
include the caption.

Cheers
Check Abdoul
------------------


Quote:
> As far as I know, you will need to just put a static text box beside the
> control in question.(Except CButton).

> Keith


> > I need a caption on a Dialog Control (such as a list box etc)

> > WS_CAPTION for control window seems to be ignored.

> > A border is created but no caption.

> > Any ideas how to get this to work ?



Mon, 11 Nov 2002 03:00:00 GMT  
 Window Caption for a Dialog Box Control
WS_CAPTION has meaning only for windows that support captions, such as
dialog windows.

For other controls (edit controls, list boxes, etc.) use a static
control. Make sure the tab order is set up so the static control
precedes the control it labels in tab order (the rule is that if you
use a name like &Names in a static control, and the user hits Alt-N,
focus goes to the first active control that follows the static
control, which means it has to be the next control in tab order).
                        joe



Quote:
>I need a caption on a Dialog Control (such as a list box etc)

>WS_CAPTION for control window seems to be ignored.

>A border is created but no caption.

>Any ideas how to get this to work ?

Joseph M. Newcomer [MVP]

Web: http://www3.pgh.net/~newcomer
MVP Tips: http://www3.pgh.net/~newcomer/mvp_tips.htm


Mon, 11 Nov 2002 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Change the caption of the dialog box

2. How do I change the caption on an MFC Dialog box (dynamically)

3. How to change on runtime the caption of a C++ dialog app main window

4. How to change on runtime the caption of a C++ dialog app main window

5. HELP: activex control in dialog box in mfc user dll (dialog not launching)

6. Dialog box as a main window in windows 95, using Win32 SDK only (MSVC 5.00)

7. Problem adding a control (calender control) to the dialog box in vc 4.2

8. Setting Text of Edit Control in Dialog Box of Control Panel Applet

9. Modeless dialog box together with modal dialog box

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

11. Dialog box in a dialog box

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

 

 
Powered by phpBB® Forum Software