Hello,

This is a general question, so, I don't think code is necessary.
I have a basic question about buttons in Win32 API... (Solution in MFC is also OK!).

I was doing some experiments in push buttons, using MFC... I can enable/disable a button as I wish, but, there is one thing I can't do and I am not able find how is the action "termed". So I will explain it :
From, a user's point of view, if I am going through settings of an application, there are various buttons and if I want to enable a setting, I click a button. The button stays Pushed. One more example is, If you are on XP and click on Start button, the button stays pushed until you click somewhere else or close the Start Menu...

So, is there anyway we can do this except do a bitmap button ourselves and define statuses?

I hope I am clear in my question...

Thanks in Advance

Maybe you should use a check button. Or search these links for something similar to what you are looking for. codeproject.com has a wealth of MFC and other code.

commented: You are always the best +1

I had searched in codeproject before, but, not in detail... Anyway, thanks for the answer. I am hoping for some more answers, while I go on searching some more...

This is something similar to what you want -- not exactly but in the ballpark. The button image changes when you hover the mouse over it, so you should be able to change the behavior to make the image stay in place after clicking it.

Class CButton's create method takes button style argument - MSDN Reference

Well, thank you... I had a learning of all the kinds of button styles, but, nonetheless, there is none which I want. The BS_PUSHLIKE unfortunately, does not support push buttons :(

This is something similar to what you want -- not exactly but in the ballpark. The button image changes when you hover the mouse over it, so you should be able to change the behavior to make the image stay in place after clicking it.

Well, thank ya dragon, but, I had figured out doing such a button with bitmaps earlier, but, I was searching for a inbuilt mechanism so that we do not have to generate bitmap buttons for all languages in my project...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.