dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dotgnu-pnet-commits] CVS: pnetlib/samples FormsHello.cs,1.6,1.7


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnetlib/samples FormsHello.cs,1.6,1.7
Date: Mon, 16 Jun 2003 21:04:57 -0400

Update of /cvsroot/dotgnu-pnet/pnetlib/samples
In directory subversions:/tmp/cvs-serv23887/samples

Modified Files:
        FormsHello.cs 
Log Message:


Implement docking and anchoring in the "Control" class.


Index: FormsHello.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/samples/FormsHello.cs,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** FormsHello.cs       16 Jun 2003 01:56:11 -0000      1.6
--- FormsHello.cs       17 Jun 2003 01:04:55 -0000      1.7
***************
*** 35,38 ****
--- 35,43 ----
                SetStyle(ControlStyles.ResizeRedraw, true);
  
+               // Set some initial form properties.
+               Width = 400;
+               Height = 270;
+               Text = "Forms Hello";
+ 
                // Create a button control on the form.
                button = new Button();
***************
*** 42,49 ****
                
                // Create a progress bar control
!               progress=new ProgressBar();
                progress.Location = new Point(30, 200);
                Controls.Add(progress);
  
                // Hook up interesting events.
                Paint += new PaintEventHandler(HandlePaint);
--- 47,62 ----
                
                // Create a progress bar control
!               progress = new ProgressBar();
                progress.Location = new Point(30, 200);
+               progress.Anchor = AnchorStyles.Left | AnchorStyles.Right;
                Controls.Add(progress);
  
+               // Create a label and dock it to the bottom.
+               Label label = new Label();
+               label.Text = "This is a label, docked to the bottom ...";
+               label.BackColor = Color.White;
+               label.Dock = DockStyle.Bottom;
+               Controls.Add(label);
+ 
                // Hook up interesting events.
                Paint += new PaintEventHandler(HandlePaint);
***************
*** 58,67 ****
  
                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();
  
--- 71,80 ----
  
                Pen pen = new Pen(Color.Black, 1.0f);
!               graphics.DrawLine(pen, 0, 0, bounds.Width, bounds.Height - 23);
                pen.Dispose();
  
                pen = new Pen(Color.Red, 2.0f);
                graphics.DrawRectangle
!                       (pen, 10, 10, bounds.Width - 20, bounds.Height - 40);
                pen.Dispose();
  
***************
*** 99,105 ****
        {
                FormsHello form = new FormsHello();
-               form.Width = 400;
-               form.Height = 250;
-               form.Text = "Forms Hello";
                Application.Run(form);
        }
--- 112,115 ----





reply via email to

[Prev in Thread] Current Thread [Next in Thread]