开发者

How to create custom context menu on title bar in .NET Windows Forms?

How can I create a custom con开发者_StackOverflow中文版text menu on windows title bar (like in Opera 10 or Firefox 4) that works on Windows XP and above?

https://wiki.mozilla.org/images/e/e8/Firefox-4-Mockup-i05-(XP)-(Royale)-(TabsTop)-(Default).png

Thanks in advance, Josh


It involves handling of the non-client area drawing through Win32 interop, which requires somewhat deep knowledge of how Windows windowing system works. Luckily, it's one of the questions that comes quite often on the web, including here on SO. For example, you can read some details on what needs to be done in this answer (conveniently posted by me some time ago :-)) and the accepted answer to the same question links to a tutorial on how to do it with WinForms.

Side note: The whole "I want to draw something in the title bar" thing is an interesting technical problem, and solving it will definitely lead to better and deeper understanding of how Windows works. However, actually adding it as a feature to a business application requires a lot of efforts to properly design and implement and should be done only when there are serious user experience benefits from doing it - which in my opinion is rarely the case.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜