Opera and Firefox 4 draw on the form's caption, why can't I?
I've been trying to achieve this for months now and nothing seems to work!
Both Opera and Firefox 4 draw their menu button on the top-left corner. I can tell from a mile away that the button's ON THE FORM, because, when minimizing the form, the shrinking minimize effect shows the buttons, and the tabs. I couldn't find any working ways 开发者_运维问答or code in C# to do this, or in C++. I know this is possible, but does any of you happen to know how? You'd be helping a lot of people if you'd tell us.search on internet how to draw anything on the non client area of a window.
in the times I was working with Visual C++ I was able to do so if I remember right taking care of the WM_NCPAINT which paints on the non client area, I do not have examples here but it should not be a problem to find some code on Internet.
I guess there are not builtin methods to do it in c# other than overriding the windowProc...
I think WM_NCPAINT should do the job for you, as indicated by Davide Piras.
Otherwise, the easiest way to have a customized title bar would be not to have a title bar at all. And then mimic the title bar functionality in the client area of the form. You will have to handle a few messages by yourself, though.
精彩评论