[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Dotgnu-pnet-commits] CVS: pnetlib/samples FormsHello.cs,1.5,1.6
From: |
Rhys Weatherley <address@hidden> |
Subject: |
[Dotgnu-pnet-commits] CVS: pnetlib/samples FormsHello.cs,1.5,1.6 |
Date: |
Sun, 15 Jun 2003 21:56:15 -0400 |
Update of /cvsroot/dotgnu-pnet/pnetlib/samples
In directory subversions:/tmp/cvs-serv23466/samples
Modified Files:
FormsHello.cs
Log Message:
Use the client rectangle to paint, not the form bounds.
Index: FormsHello.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/samples/FormsHello.cs,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** FormsHello.cs 13 Jun 2003 20:58:27 -0000 1.5
--- FormsHello.cs 16 Jun 2003 01:56:11 -0000 1.6
***************
*** 55,65 ****
Graphics graphics = e.Graphics;
Form form = (sender as Form);
Pen pen = new Pen(Color.Black, 1.0f);
! graphics.DrawLine(pen, 0, 0, form.Width, form.Height);
pen.Dispose();
pen = new Pen(Color.Red, 2.0f);
! graphics.DrawRectangle(pen, 10, 10, form.Width - 20,
form.Height - 20);
pen.Dispose();
--- 55,67 ----
Graphics graphics = e.Graphics;
Form form = (sender as Form);
+ Rectangle bounds = form.ClientRectangle;
Pen pen = new Pen(Color.Black, 1.0f);
! graphics.DrawLine(pen, 0, 0, bounds.Width, bounds.Height);
pen.Dispose();
pen = new Pen(Color.Red, 2.0f);
! graphics.DrawRectangle
! (pen, 10, 10, bounds.Width - 20, bounds.Height - 20);
pen.Dispose();
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Dotgnu-pnet-commits] CVS: pnetlib/samples FormsHello.cs,1.5,1.6,
Rhys Weatherley <address@hidden> <=