开发者

how to create triangular button in c#

开发者 https://www.devze.com 2022-12-22 07:07 出处:网络
How to cre开发者_JS百科ate Custom shaped buttons in c#: say triangularYou could use a pictureBox as a button.Easiest way is to set a tringular image on the button, with transparent areas outside the t

How to cre开发者_JS百科ate Custom shaped buttons in c#: say triangular


You could use a pictureBox as a button.


Easiest way is to set a tringular image on the button, with transparent areas outside the triangle.

As others have suggested, you could also use a PictureBox object as a button and handle the "click" even of it.

Another way is probably to write a TriangleButton class that extends the Button class, then override the Paint method so that you can draw a triangle instead of the regular button shape. Not sure how to handle the "click" areas of the button (you might still have a a rectangular click region).


You create a rectangular ImageButton with a transparent background.

0

精彩评论

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

关注公众号