Peter Kiers
asked on
How to draw a top line on a panel.
Hi,
I would like to draw a line on the top edge of a panel.
I quess I need the onpain-event of the panel for that.
But I don't know how! And the line must have the color
"#c2c4cb".
Who knows the answer and is willing to help me?
Greetings, Peter Kiers
I would like to draw a line on the top edge of a panel.
I quess I need the onpain-event of the panel for that.
But I don't know how! And the line must have the color
"#c2c4cb".
Who knows the answer and is willing to help me?
Greetings, Peter Kiers
ASKER
It does not draw the whole line on the top edge of the panel.
Peter
Peter
ASKER
I have change:
e.Graphics.Drawline(p, 1, 1, 176, 1);
Now the line is as wide a the panel width.
But when I resize the panel the line stays the same!!!
e.Graphics.Drawline(p, 1, 1, 176, 1);
Now the line is as wide a the panel width.
But when I resize the panel the line stays the same!!!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Then just add something like this in the Paint Handler...
private void panel1_Paint(object sender, PaintEventArgs e)
{
Pen p = new Pen(new SolidBrush(Color.FromArgb(
e.Graphics.DrawLine(p, 1, 1, 100, 1);
}
Hope this helps...