How to draw a close button like Visual Studio?

885 Views Asked by At

Visual Studio's windows have a close button (as well as other frame controls) that blend into the caption color and appear like so:

enter image description here

I was wondering if there's an accepted way of drawing controls like that. Do controls like these use DrawFrameControl or DrawThemeBackground, or do they use another approach altogether?

Thank you for any information.

1

There are 1 best solutions below

1
On

There are two approaches for creating custom buttons using Win32 API:

1. Draw the control yourself. This is very complicated and requires a lot of knowledge about Win32 controls. Here are some links to get you started:

2. Modify an existing control using SubclassWindow. This is much easier, but in most cases very limited.

For example you can use a static control and handle mouse activity for it. You can also use multiple controls and show and move them as needed.

There is no set way of doing this since it's custom logic. But here are some links: