Jump to content

Desenhar linha num panel


nunobettencourt

Recommended Posts

Bem, estou com dificuldade em desenhar uma linha num panel, aqui fica o código ...

private void Form1_Load(object sender, System.EventArgs e) {
		this.panel1.Paint += new PaintEventHandler(panel1_Paint);
}

private void panel1_Paint(object sender, PaintEventArgs e) {
		Graphics g = e.Graphics ;
		Pen pen = new Pen(Color.Red);
		g.DrawLine(pen, 122, 40, 122, 140);
		g.Dispose();
}
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.