Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to keep a button down

Status
Not open for further replies.

victor7

Programmer
Jul 30, 2002
11
0
0
US
Hello, I wanted to know how to have a button look like it was pushed down after being pressed. For example, I have two square buttons that each show a different layout. So when I push one of the buttons, it will display a page and the button will look like it is still pushed down.

thank you.
 
Either create the button with the BS_PUSHBUTTON style:
Code:
CButton myButton;
myButton.Create(_T("My button"), WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON, 
  CRect(10,10,100,30), pParentWnd, 1);

Or add the BS_PUSHBUTTON style to an existing button:
Code:
myButton.SetButtonStyle(BS_PUSHBUTTON);
You could also "group" two or more related buttons when only one can be selected at any given time.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top