Kbitnik
Messages postés
125
Date d'inscription
mercredi 15 novembre 2000
Statut
Membre
Dernière intervention
2 mars 2006
20 janv. 2006 à 17:32
Merci pour le g.dispose(), c cool !
par contre pour le OnPaint() jfé come sa mé sa marche pas
private void Form1_OnPaint(object sender, PaintEventArgs e)
{
Graphics g =
this.CreateGraphics();
g.DrawRectangle(
new Pen(Color.Black,1),40,40,420,200);
g.FillRectangle(
new SolidBrush(Color.LightGray),41,41,419,199);
Pen oP =
new Pen(Color.Black,1);
oP.DashStyle = DashStyle.Dot;
g.DrawLine(oP,
new Point(40,200),
new Point(460,200));
g.DrawLine(oP,
new Point(40,160),
new Point(460,160));
g.DrawLine(oP,
new Point(40,120),
new Point(460,120));
g.DrawLine(oP,
new Point(40,80),
new Point(460,80));
g.DrawLine(oP,
new Point(95,40),
new Point(95,240));
g.DrawLine(oP,
new Point(150,40),
new Point(150,240));
g.DrawLine(oP,
new Point(205,40),
new Point(205,240));
g.DrawLine(oP,
new Point(260,40),
new Point(260,240));
g.DrawLine(oP,
new Point(315,40),
new Point(315,240));
g.DrawLine(oP,
new Point(370,40),
new Point(370,240));
g.DrawLine(oP,
new Point(420,40),
new Point(420,240));
g.Dispose();
}
Ne faites pas attention a la multitude de DrawLine, jutiliserai un DrawLines.