Professional UI Solutions
Site Map   /  Register
 
 

Forum

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 » CExtRadioButton and BS_BITMAP Collapse All
Subject Author Date
John Ritzenthaler Feb 9, 2009 - 11:32 AM

I have a dialog with two radio buttons that use the BS_BITMAP attribute.


When they use CButton, they worked fine.  But once I switch to CExtRadioButton, the bitmaps are ignored and they are displayed with text.  Here are the resource entries:


    CONTROL         "Portrait",IDC_ORIENT_PORT,"Button",BS_AUTORADIOBUTTON | BS_BITMAP | BS_CENTER | BS_VCENTER | BS_PUSHLIKE | WS_GROUP | WS_TABSTOP,231,7,16,16

    CONTROL         "Landscape",IDC_ORIENT_LAND,"Button",BS_AUTORADIOBUTTON | BS_BITMAP | BS_CENTER | BS_VCENTER | BS_PUSHLIKE | WS_TABSTOP,250,7,16,16


Here are the code references to them


 DDX_Control(pDX, IDC_ORIENT_LAND, m_btnPrtLand);

 DDX_Control(pDX, IDC_ORIENT_PORT, m_btnPrtPort);




 hBitmap   = ::LoadBitmap(AfxGetApp()->m_hInstance, MAKEINTRESOURCE(IDB_PRT_PORT));

 m_btnPrtPort.SetBitmap(hBitmap);

 hBitmap   = ::LoadBitmap(AfxGetApp()->m_hInstance, MAKEINTRESOURCE(IDB_PRT_LAND));

 m_btnPrtLand.SetBitmap(hBitmap);

Technical Support Feb 9, 2009 - 1:34 PM

The CExtRadioButton always draws a radio button shape with text and nothing else. You can use the MFC’s CButton class "as is" or you can use the CExtIconButton class from Prof-UIS 2.84. You can see the CExtIconButton buttons at the top of the CExtShellDialogFile dialog demonstrated on the File Dialog page in the ProfUIS_Controls sample application. The CExtIconButton class uses flat button appearance and CExtButton::m_icon icon property to draw on its surface.