Author: pbartok
Date: 2006-01-13 13:35:12 -0500 (Fri, 13 Jan 2006)
New Revision: 55536

Added:
   trunk/winforms/dockpadding/
   trunk/winforms/dockpadding/Makefile
   trunk/winforms/dockpadding/dockpadding.cs
Log:
- Dockpadding test app


Added: trunk/winforms/dockpadding/Makefile
===================================================================
--- trunk/winforms/dockpadding/Makefile 2006-01-13 18:28:29 UTC (rev 55535)
+++ trunk/winforms/dockpadding/Makefile 2006-01-13 18:35:12 UTC (rev 55536)
@@ -0,0 +1,7 @@
+all: dockpadding.exe
+
+dockpadding.exe: dockpadding.cs
+       mcs -debug dockpadding.cs /r:System.Windows.Forms.dll 
/r:System.Drawing.dll
+
+clean:
+       rm dockpadding.exe -r -f

Added: trunk/winforms/dockpadding/dockpadding.cs
===================================================================
--- trunk/winforms/dockpadding/dockpadding.cs   2006-01-13 18:28:29 UTC (rev 
55535)
+++ trunk/winforms/dockpadding/dockpadding.cs   2006-01-13 18:35:12 UTC (rev 
55536)
@@ -0,0 +1,89 @@
+using System;
+using System.Drawing;
+using System.Collections;
+using System.ComponentModel;
+using System.Diagnostics;
+using System.Windows.Forms;
+
+namespace DickPadding {
+       public class Form1 : System.Windows.Forms.Form {
+               private Panel p;
+               private Button b;
+
+               public Form1() {
+                       InitializeComponent();
+               }
+
+               int myCounter = 0;
+               private void SetDockPadding() {
+                       b.Dock = System.Windows.Forms.DockStyle.Fill;
+    
+                       if (myCounter > 5) {
+                               myCounter = 0;
+                       }
+ 
+                       switch (myCounter) {
+                               case 0:
+                                       p.DockPadding.All = 0;
+                                       b.Text = "Start";
+                                       break;
+                               case 1:
+                                       p.DockPadding.Top = 10;
+                                       b.Text = "Top";
+                                       break;
+                               case 2:
+                                       p.DockPadding.Bottom = 10;
+                                       b.Text = "Bottom";
+                                       break;
+                               case 3:
+                                       p.DockPadding.Left = 10;
+                                       b.Text = "Left";
+                                       break;
+                               case 4:
+                                       p.DockPadding.Right = 10;
+                                       b.Text = "Right";
+                                       break;
+                               case 5:
+                                       p.DockPadding.All = 20;
+                                       b.Text = "All";
+                                       break;
+                       }
+    
+                       myCounter += 1;
+               }
+
+               private void InitializeComponent() {
+                       p = new Panel();
+                       b = new Button();
+
+                       this.SuspendLayout();
+
+                       p.Location = new System.Drawing.Point(8, 40);
+                       p.Name = "panel";
+                       p.Size = new System.Drawing.Size(272, 152);
+                       p.BackColor = Color.SkyBlue;
+                       p.DockPadding.All = 10;
+
+                       b.Location = new Point(8, 8);
+                       b.Text = "Start";
+                       b.Click += new EventHandler(b_Click);
+
+                       this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
+                       this.ClientSize = new System.Drawing.Size(292, 266);
+                       Controls.Add(this.p);
+                       p.Controls.Add(this.b);
+                       this.Name = "Form1";
+                       this.Text = "Form1";
+                       this.ResumeLayout(false);
+               }
+
+               [STAThread]
+               static void Main() {
+                       Application.Run(new Form1());
+               }
+
+               private void b_Click(object sender, EventArgs e) {
+                       SetDockPadding();
+               }
+       }
+}


Property changes on: trunk/winforms/dockpadding/dockpadding.cs
___________________________________________________________________
Name: svn:executable
   + *

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to