Add Icon to Titlebar (right side)

R

rob

I would like to add an icon to the RIGHT side of an application's
titlebar. Basically, it will supplement the other icons already there.
Is there any direct support in .NET 2.0 to do this? If not I assume I
would have to subclass the windows form but what exactly would I do
there?

Also how can a make sure that the icon keeps the same style as the
other icons? Ideally, there would be some "empty" icon (for instance a
minimize icon without the minimize sign) and then I could simply draw
on this icon or merge it with another icon that has transparancy for
the background.

Thanks
 
N

Nicholas Paldino [.NET/C# MVP]

Rob,

No, there is no support to do this. You would have to override the
WndProc method of your class and handle the WM_NCPAINT message, which is
sent to paint the frame of the form.

As for getting the default button, that's going to be hard. You could
use the visual styles api, but it doesn't have anything for an "empty"
button. Rather, you can paint a different button (max, min, etc, etc), and
then just paint inside of it.

Hope this helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top