blejzz
blejzz

Reputation: 3349

c++ win32 create a text only button

I would like to add a simple text button to my c++ win32 application. I'm creating the button using CreateWindowEx function, but can't figure out the correct style to do so. I would like to display a text only button and be able to recive messages when the user clicks on it. The style i would like to get is identical to the text button in windows 7 system volume control (where it says "Mixer"). If possible i would like to display a tooltip also.

enter image description here

Upvotes: 3

Views: 987

Answers (3)

Larry Osterman
Larry Osterman

Reputation: 16142

Actually that button is an owner draw button - it listens to mouse move messages and when you hover over it, it underlines the text (the syslink control doesn't have this behavior). Otherwise it's a stock button.

Upvotes: 3

Jim Rhodes
Jim Rhodes

Reputation: 5095

You could create a "Button" class window with the BS_OWNERDRAW style and handle the WM_DRAWITEM messages. In your WM_DRAWITEM message handler you can simply display the text.

Upvotes: 3

David Heffernan
David Heffernan

Reputation: 613531

That mixer control looks more like a hyperlink control than a button. I'd go for the SysLink control if that's what you need.

Upvotes: 5

Related Questions