Professional UI Solutions
Site Map   /  Register


Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » CStatic question Collapse All
Subject Author Date
tera tera Mar 31, 2009 - 1:24 AM


I want to always display CStatic on the front.

Please teach it if you know a good method.


I wonder if there is only the following programming technique.

LRESULT CSampleBkPaintDlg::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)


   LRESULT lRes = CDialog::WindowProc(message, wParam, lParam);

   if ( message == WM_MOUSEMOVE ){




Technical Support Mar 31, 2009 - 10:36 AM

If you want to display some text in the CExtLabel window using custom font and/or color, you should use the CWnd::SetWindowText() method for assigning the label text and use the following methods of the CExtLabel class to customize label’s font and/or color:

   void SetFontBold( bool bSet = true );
            void SetFontItalic( bool bSet = true );
            void SetFontUnderline( bool bSet = true );
            void SetFontStrikeOut( bool bSet = true );
            void SetBkColor( COLORREF clrBk );
            void SetTextColor(
                        bool bEnabled,
                        COLORREF clrText = COLORREF(-1L)
If you need to change this parameters of the CExtLabel control on mouse hover, please handle the WM_MOUSEMOVE message in your CExtLabel-derived class.

tera tera Mar 31, 2009 - 6:40 PM


Even if I choose other control

In defiance of those drawing, I want to always display CStatic in the front row

If there is a good idea, please teach it.


Technical Support Apr 2, 2009 - 5:13 AM

You should make the Z-order of the static control less than any of of other dialog controls. You can adjust the Z-order by opening your dialog template resource in Visual Studio and pressing Ctrl+D. You can also change the Z-order of your static control programmatically (by using the SetWindowPos() API).