日期:2014-05-18  浏览次数:21145 次

C#怎样制作圆形按钮
我想用C#实现制作一个圆形按钮,该怎样实现呢?或者有没有现成的控件呢?

------解决方案--------------------
自己写个控件,然后自己重绘自己的控件的外观形状,我曾经是这么做得,不过没有全部完成,因为离开那个公司咯,不过有vb源码。还可以把我没有做完的c#程序给你下,不过圆形形状还是能够实现哈。需要的话就下邮箱吧!
------解决方案--------------------
c#里制作不规则按扭很容易的,如果按扭边框比较规则的话!
GraphicsPath myPath = new GraphicsPath();
myPath.AddEllipse(0,0,50,50); //自己改成你想要的路径
this.button1.Region=new Region(myPath);

------解决方案--------------------
private void button7_Click(object sender, EventArgs e)
{
int hw = button7.Height;
if (hw > button7.Width) hw = button7.Width;
System.Drawing.Drawing2D.GraphicsPath gp = new System.Drawing.Drawing2D.GraphicsPath();
gp.AddEllipse(4, 4, hw - 8, hw - 8);
gp.FillMode = System.Drawing.Drawing2D.FillMode.Winding;
button7.BackColor = Color.Red;
button7.Region = new Region(gp);
}
------解决方案--------------------
http://download.csdn.net/tag/%E5%9C%86%E5%BD%A2%E6%8C%89%E9%92%AE%E6%BA%90%E4%BB%A3%E7%A0%81