我现在有个类似toolbar的小工具是矩形的,现要求将其美化,
将四个直角作圆滑处理,我试过把窗体画成椭圆形,但是不是那个效果
各位大虾们有何高见,希望不吝赐教,小弟非常感谢
解决方案 »
- 语法问题:方法函数之前打中括号[...]中的一行代码是做什么的,如何使用?
- 请教关于Visual Studio代码自动生成,灰常简单
- 存储过程
- 如何将任务栏设置成自动隐藏,而不是隐藏
- 能否用DadatGridView实现发票的样式能进行动态操作
- .net2005里面没有timer控件,怎么实现这个控件的功能?///////////
- 初学.NET,被CollectionBase和LIST的关系搞糊涂了
- 新手写操作系统的讨论,绝对可行的方案
- 请各位高手们看看,这个C#调用C+dll有问题没
- 如何判断c# Dictionary 已存生一个key,不能再增加了
- 关于C#字符串的处理(马上给分)
- c#事务处理
protected override void OnPaint(PaintEventArgs e)
{
System.Drawing.Graphics dc = e.Graphics;
Pen bluePen = new Pen(Color.Blue, 3);
GraphicsPath gp = new GraphicsPath();
float X = 0;
float Y = 0;
float width = 200;
float height= 50;
float radius=10; gp.AddLine(X + radius, Y, X + width - (radius * 2), Y); gp.AddArc(X + width - (radius * 2), Y, radius * 2, radius * 2, 270, 90); gp.AddLine(X + width, Y + radius, X + width, Y + height - (radius * 2)); gp.AddArc(X + width - (radius * 2), Y + height - (radius * 2), radius * 2, radius * 2, 0, 90); gp.AddLine(X + width - (radius * 2), Y + height, X + radius, Y + height); gp.AddArc(X, Y + height - (radius * 2), radius * 2, radius * 2, 90, 90); gp.AddLine(X, Y + height - (radius * 2), X, Y + radius); gp.AddArc(X, Y, radius * 2, radius * 2, 180, 90); gp.CloseFigure(); dc.DrawPath(bluePen, gp); this.Region = new Region(gp); base.OnPaint(e);
}