Thread: Get Down and Stay Down Buttons?

  1. #1
    int x = *((int *) NULL); Cactus_Hugger's Avatar
    Join Date
    Jul 2003
    Location
    Banks of the River Styx
    Posts
    902

    Question Get Down and Stay Down Buttons?

    How can I make a button stay down until clicked again?

    I saw:
    BS_PUSHLIKE Makes a button (such as a check box, three-state check box, or radio button) look and act like a push button. The button looks raised when it isn't pushed or checked, and sunken when it is pushed or checked.

    As a button style, so I did a:
    Code:
    SendDlgItemMessage(hwndDlg, IDB_GP_GAME, BM_SETSTYLE, (WPARAM) LOWORD(BS_PUSHLIKE), MAKELPARAM(1, 0));
    in the WM_INITDIALOG. However, nothing happened. (The button is still a normal button!)

    Can anyone give me a bit of help as what to do?

    Thanks!
    long time; /* know C? */
    Unprecedented performance: Nothing ever ran this slow before.
    Any sufficiently advanced bug is indistinguishable from a feature.
    Real Programmers confuse Halloween and Christmas, because dec 25 == oct 31.
    The best way to accelerate an IBM is at 9.8 m/s/s.
    recursion (re - cur' - zhun) n. 1. (see recursion)

  2. #2
    Registered User
    Join Date
    Jun 2003
    Posts
    70
    I think 'CBitmapButton' class will be helpful to you.
    Chintan R Naik

  3. #3
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    I suspect that when msdn says
    BS_PUSHLIKE
    Makes a button (such as a check box, three-state check box, or radio button) look and act like a push button. The button looks raised when it isn't pushed or checked, and sunken when it is pushed or checked.
    what it means is that it only works for a check-box, 3-state or radio button.

    Things you might like to try:
    1. Use SetWindowPos to force a complete repaint/update of the control after you change the style.
    2. Create a button control with the BS_PUSHLIKE style and see if it makes any difference to the appearance/state of that button.

    If that fails just create an owner-draw button and use DrawFrameControl to draw the button in whatever state you want.

Popular pages Recent additions subscribe to a feed