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 General Discussion » Switch from CExButton to CButton Collapse All
Subject Author Date
Pascal Pinchauret-Lamothe Oct 18, 2010 - 3:09 AM


My development environment is Visual C++ 6 under Windows XP.
I have a CExButton control which is displayed flat by default with a tooltip.
In some cases, I would like to display it as a standard MFC CButton control (in 3D style but keeping its tooltip) and in some other cases I want to display it again like a CExButton control (flat).
Please how to do that with the CExButton class?
Thanks in advance.

Best regards.

Technical Support Oct 18, 2010 - 12:04 PM

The CExtButton class implements a skinned version of the button common control. It does not expect to have old Windows 2000/NT/9x non client area edges. Please use an alternative way to highlight your buttons. For instance, Prof-UIS 2.90 supports HTML everywhere you used to see only plain text, including button captions. You can specify some HTML text inside your button. This HTML can contain any CSS based borders.

Additionally, it’s not possible to convert CExtButton to CButton on the fly. I.e. just by overriding WindowProc() virtual method. The CExtButton control saves subclassed type of button and convert’s itself into custom drawn type of button. This is the only way to implement a repainted button control.

Pascal Pinchauret-Lamothe Oct 18, 2010 - 6:13 AM


(I meant CExtButton and not CExButton of course :-)

I didn’t find the way to solve my problem using CExtButton class but I used Windows API to do the job (see my code below):

// Switch from flat to 3D button according to a boolean
if (b3D)
    p_oDefectsCtrl.ModifyStyleEx(0, dwWindowsStyle3D, SWP_FRAMECHANGED);
    p_oDefectsCtrl.ModifyStyleEx(dwWindowsStyle3D, 0, SWP_FRAMECHANGED);