Click here to Skip to main content
15,884,537 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi,

I have several CButton's in a COleControl. Whenever I click on any of the buttons the button draws itself in the down state even after the button is released. I do not seem to be able to get it to draw in the normal state again after a press.

Here is how I create the buttons, I have tried using the normal 3D style but still get the same problem.
m_btnLeftPage.Create( _T("<<"), WS_CHILD|BS_PUSHBUTTON|BS_FLAT, CRect(0,0,0,0), this, BTN_LEFTPAGE_ID );
    m_btnLeft.Create( _T("<"), WS_CHILD|BS_PUSHBUTTON|BS_FLAT, CRect(0,0,0,0), this, BTN_LEFT_ID );
    m_btnZoomInX.Create( _T("+"), WS_CHILD|BS_PUSHBUTTON|BS_FLAT, CRect(0,0,0,0), this, BTN_ZOOMINX_ID );
    m_btnZoomOutX.Create( _T("-"), WS_CHILD|BS_PUSHBUTTON|BS_FLAT, CRect(0,0,0,0), this, BTN_ZOOMOUTX_ID );
    m_btnRight.Create( _T(">"), WS_CHILD|BS_PUSHBUTTON|BS_FLAT, CRect(0,0,0,0), this, BTN_RIGHT_ID );
    m_btnRightPage.Create( _T(">>"), WS_CHILD|BS_PUSHBUTTON|BS_FLAT, CRect(0,0,0,0), this, BTN_RIGHTPAGE_ID );


The buttons are given the correct size and position in OnSize().

Any suggestions?

Thanks - John
Posted
Updated 6-Jun-11 3:46am
v6

1 solution

http://msdn.microsoft.com/en-us/library/ms907525.aspx[^]

check the MSDN link to create button of different style
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900