当前位置:编程学习 > C#/ASP.NET >>

在C#的子窗体画图

代码如下:
public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        public Form1(Button button1)
        {
            InitializeComponent();
            this.button1.Hide();
        }
        
        private void ViewInstanceDialog_Paint(object sender, PaintEventArgs e)
       {
        // 为窗体中画线
        Graphics line = CreateGraphics();
        line.DrawLine(new Pen(Color.Gray, 1), new Point(10, 280), new Point(Width - 20, 280));
        line.DrawLine(new Pen(Color.White, 1), new Point(10, 281), new Point(Width - 20, 281));
        }


        private void button1_Click(object sender, EventArgs e)
        {
            Form form2=new Form1(button1);
            form2.ShowDialog();
            form2.ViewInstanceDialog_Paint();
        }

    } c# --------------------编程问答-------------------- 各路大侠伸手教教小弟
补充:.NET技术 ,  C#
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,