如何在vb.net中更改命令按钮的形状 [英] How to change shape of command button in vb.net

查看:473
本文介绍了如何在vb.net中更改命令按钮的形状的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在vb.net中更改命令按钮的形状

推荐答案

要设置非矩形形状的控件,您可以需要将其属性System.Windows.Forms.Control.Region设置为某些非矩形区域(类型为System.Drawing.Region).

这是使用Forms的唯一方法.不使用Region的方式可能仅在视觉上产生非矩形的印象,但是使用鼠标操作可以轻松证明这是作弊行为.在实际的非矩形中,鼠标事件仅随区域一起分派给控件.

大约是System.Windows.Forms.在WPF中,这更容易实现.你感兴趣吗? (很遗憾,您没有标记要使用的UI库.请这样做!)

-SA
To set up a non-rectangular shape of control, you need to set its property System.Windows.Forms.Control.Region to some non-rectangular region (of the type System.Drawing.Region).

This is the only way to do it with Forms. The ways not using Region may only visually create a non-rectangular impression, but operating with mouse can easily proof this is cheating. In real non-rectangular, mouse events are dispatched to the control only withing the region.

That was about System.Windows.Forms. In WPF, this is much easier to do. Are you interested? (Too bad you did not tag the UI library you want to use. Do it!)

—SA


签出@ @ 具有颜色和形状的自定义按钮 [ ^ ]

并遵循线程@ http://social. msdn.microsoft.com/Forums/zh-CN/winformsdesigner/thread/270c9154-5f09-4d71-a5cd-ac94041d7bc9/ [
Check out code project article posted @ Custom Button with Color and Shape[^]

and follow the thread @ http://social.msdn.microsoft.com/Forums/en-US/winformsdesigner/thread/270c9154-5f09-4d71-a5cd-ac94041d7bc9/[^]


这篇关于如何在vb.net中更改命令按钮的形状的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆