按钮控件的形状 [英] shape of a button control
本文介绍了按钮控件的形状的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我想知道是否可以给按钮控制其他任何说多边形的形状
等待答案
neaS
hi all,
i want to know that is it possible to give button control any other shape says a polygon
waiting for answer
neaS
推荐答案
这是关键:要赋予按钮真正非矩形形状,您需要分配其Region
属性,自然地,到非矩形区域.您甚至可以生成非矩形Form
!
有许多作品(Ravi引用了其中的一件作品)无法做到这一点,并且只能产生非矩形按钮的外观,但是控件实际上是矩形的.很容易发现实现很简单:单击角落(或矩形边界区域中不应该属于按钮的位置).如果未设置区域",则即使不应这样做,按钮也将表现为单击状态.
分配区域-这是唯一正确的方法.
—SA
Here is the key: to give a button really non-rectangle shape, you need to assign itsRegion
property, naturally, to a non-rectangular Region. You can even produce non-rectangularForm
!
There is a number of works (one of them is referenced by Ravi) which fail to do it and produce only a look of non-rectangular button, but the control is in fact rectangular. It''s easy to find out that the implementation is louse: click in the corner (or a place of the rectangular bounding area which is not supposed to belong to a button). If Region is not set up, the button will behave as clicked even though it is not supposed to do so.
Assign Region — this is the only correct way.
—SA
您在这里
脉冲按钮 [使用GDI +的增强型GlassButton [按钮控件@ Codeproject [ Control.Region属性 [ ^ ].继续
Here you go
Pulse Button[^]
Enhanced GlassButton using GDI+[^]
For more browse here Button Controls @ Codeproject[^]
EDIT
------------------
SA is right. Found this in MSDN. Control.Region Property[^]. Go ahead
尝试
具有颜色和形状的自定义按钮 [
Try
Custom Button with Color and Shape[^]
这篇关于按钮控件的形状的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文