在标题栏中添加自定义按钮 VB.NET
我只是想知道是否有可能使用 VB.NET 将自定义按钮添加到标题栏中。我在 Stack Overflow 上看到过很多这样的问题,但未能得到确定且有效的答案。
谁能帮我解决这个问题吗?我也检查过谷歌和其他网站,但它无法呈现。我希望代码能够在 Windows XP、Windows Vista 和 Windows 7 上运行。
如果您能够提供有效的代码,并且该按钮甚至必须能够接受点击事件并发布,我将感激将其更改为执行某些操作时所使用的形式。
提前致谢
I was just wondering if there was a possible way to add a custom button into the title bar using VB.NET. I've seen many such questions on Stack Overflow but failed to get a sure-shot and a working answer.
Can anyone help me around with this issue? I've checked on Google and other website too but it fails to render. I want the code to work on Windows XP, Windows Vista and Windows 7.
I would be grateful if you will be able to give a working code and the button must even be able to accept click events and post it to the form it is on for some action.
Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果你指的是winforms,我可以想到两种方法来做到这一点:
If you mean winforms, I can think of two ways to do this:
以下是一些工作代码的示例:
http://www .dreamincode.net/forums/topic/69215-2008-custom-title-bar/
基本上,您需要创建一个没有边框的表单,然后滚动您自己的“标题栏”,它基本上是位于顶部,您可以根据需要进行自定义。这是一个很难完全正确实施的解决方案,但这可能是实现这一目标的最佳方式。
Here is an example with some working code:
http://www.dreamincode.net/forums/topic/69215-2008-custom-title-bar/
Basically, you need to create a form with no border, then roll your own "Titlebar" which will basically be an area at the top that you can customize however you want. This is a difficult solution to fully implement properly, but it is probably the way that will best accomplish this.
正如 Matthew Scharley 在中所写的那样在这里回答:
我认为这在 Vista 和 7 中不会以图形方式显示。Matthew 代码的翻译版本如下:
As Matthew Scharley writes in his answer here:
I think this doesn't show up graphically in Vista and 7. The translated version of Matthew's code is as follows: