| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 890 人关注过本帖
标题:c#参数 这里是怎么传递的?
取消只看楼主 加入收藏
aamen110
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2011-8-14
结帖率:50%
收藏
已结贴  问题点数:10 回复次数:0 
c#参数 这里是怎么传递的?
public partial class Form1 : Form
    {
      
        public Form1()
        {
            InitializeComponent();
        }

      

        private void button3_Click(object sender, EventArgs e)
        {
            shape line = new line(10, 10, 100, 100);
            line.draw(this.panel1.CreateGraphics());
           
        }

        private void button1_Click(object sender, EventArgs e)
        {
            shape ep = new eillpse(20, 20, 200, 200);
            ep.draw(this.panel1.CreateGraphics());
        }

        private void button2_Click(object sender, EventArgs e)
        {
            shape re = new eillpse(20, 20, 200, 200);
            re.draw(this.panel1.CreateGraphics());
        }
    }

   public  class line :shape
   {
       public line(int x1, int y1, int x2, int y2)
           : base(x1, y1, x2, y2)
       { }
       public override void draw(Graphics g)
       {
         
          Pen mypen =new Pen (Color .Red )   ;
          g.DrawLine(mypen , this.X1  , this.Y1, this.X2, this.Y2);
       }
        
    }
 public class eillpse : shape
    {
        public eillpse(int x1, int y1, int x2, int y2)
            : base(x1, y1, x2, y2)
        { }
        public override void draw(Graphics g)
        {

            Pen mypen = new Pen(Color.Red);
            g.DrawEllipse(mypen, this.X1, this.Y1, this.X2, this.Y2);
        }

    }
 public class regricle : shape
    {
        public regricle(int x1, int y1, int x2, int y2)
            : base(x1, y1, x2, y2)
        { }
        public override void draw(Graphics g)
        {

            Pen mypen = new Pen(Color.Red);
            g.DrawRectangle(mypen, this.X1, this.Y1, this.X2, this.Y2);
        }

    }
搜索更多相关主题的帖子: private public class 
2011-10-21 23:14
快速回复:c#参数 这里是怎么传递的?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.034226 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved