C# - 自定义程序按钮?
嘿伙计们,我正在制作一个程序,我只是想知道是否可以将您自己的按钮添加到程序“头部”,我称之为它。就像这个默认的窗口边框样式:
如果您仍然不明白我的意思,我想添加更多内容像“最小化”和“最大化”按钮这样的边框样式:
如果您能告诉我如何或指出我正确的方向我将不胜感激。
Possible Duplicate:
Display the minimize and maximize buttons on a sizable tool window?
How to add an extra button to the window's title bar?
Hey guys i'm making a program and i'm just wondering if it is possible to add your own buttons to the program "head" i'll call it. Like this default windows borderstyle:
If you still don't get what i mean, I want to add more buttons like the "Minimize" and "Maximize" buttons to this borderstyle:
If you could tell me how or point me in the right direction i would appreciate it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为它可以帮助您实现目标:
http://www.codeproject.com/ KB/cs/mintraybtn.aspx
I think it can help you to achieve your end:
http://www.codeproject.com/KB/cs/mintraybtn.aspx
尽管可以使用 WinAPI,但我不鼓励您这样做。
首先,这并不容易,并且需要很好的窗口、消息传递和类似 API 的实践。其次,您应该考虑各种“Windows”提供的不同“风格”。您知道,您可以在桌面设置面板中切换多种颜色组合。
相反,我建议您创建一个无边框窗口,这样您就可以放心地放置任何按钮。另外,我建议选择一个非常具体的样式,这样结果对于用户来说会是美观的。
希望有帮助。
干杯
Although it is possible by using the WinAPI, I would discourage you from doing that.
First off, it is not easy, and it requires a pretty good practice of windowing, messaging and similar API stuffs. Secondly, you should take in account the different "styles" that the various "Windows" offers. You know, you may switch among many color combination from within the desktop settings panel.
Instead, I would recommend you to create a borderless window, so that you may place any button with worrying. Also, I'd suggest to choose a very specific styling, so that the result will be aesthetically pleasant for the user's eyes.
Hope it helps.
Cheers