如何在c#.net中添加圆形按钮以进行winform [英] how to add round button to winform in c#.net

查看:832
本文介绍了如何在c#.net中添加圆形按钮以进行winform的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用以下代码创建圆形按钮,但我没有通过工具箱获得圆形按钮



i was used following code for create round button but i did not get roundbutton in by toolbox

class Round : Button
       {
           protected override void OnCreateControl()
           {
               using (var path = new GraphicsPath())
               {
                   path.AddEllipse(new Rectangle(2, 2, this.Width - 5, this.Height - 5));
                   this.Region = new Region(path);
               }
               base.OnCreateControl();
           }
       }

推荐答案

你必须编译代码(通常在库(dll)中)和然后右键单击工具箱并选择项目...
You have to compile the code (usually in a library (dll)) and then right-click toolbox and Choose items...


这篇关于如何在c#.net中添加圆形按钮以进行winform的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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