用c#分析二维平面上的点和圆,定义相应的类及关系,并创建对象进行测试

问题描述:

用c#分析二维平面上的点和圆,定义相应的类及关系,并创建对象进行测试
如题
把代码写出来
1个回答 分类:综合 2014-11-24

问题解答:

我来补答
private void button1_Paint(object sender,PaintEventArgs e)
{
System.Drawing.Drawing2D.GraphicsPath myGraphicsPath = new
System.Drawing.Drawing2D.GraphicsPath();
myGraphicsPath.AddEllipse(new Rectangle(0,0,125,175));
myGraphicsPath.AddEllipse(new Rectangle(75,95,20,20));
myGraphicsPath.AddEllipse(new Rectangle(120,0,125,175));
myGraphicsPath.AddEllipse(new Rectangle(145,95,20,20));
//改变按钮的背景颜色使之能被容易辨认
button1.BackColor = Color.Blue;
button1.Size = new System.Drawing.Size(256,256);
button1.Region = new Region(myGraphicsPath);
}
有的控件有Paint事件,可以重画
 
 
展开全文阅读
剩余:2000
下一页:铜,及其化合物