|
|
@@ -7,14 +7,14 @@
|
|
|
//
|
|
|
|
|
|
using System;
|
|
|
-using System.Drawing;
|
|
|
-using System.Windows.Forms;
|
|
|
-
|
|
|
-namespace demo2
|
|
|
-{
|
|
|
-
|
|
|
- public class GtkForm : System.Windows.Forms.Form
|
|
|
- {
|
|
|
+using System.Drawing;
|
|
|
+using System.Windows.Forms;
|
|
|
+
|
|
|
+namespace demo2
|
|
|
+{
|
|
|
+
|
|
|
+ public class GtkForm : System.Windows.Forms.Form
|
|
|
+ {
|
|
|
private Button button1 = new Button();
|
|
|
private Button button2 = new Button();
|
|
|
private ColorDialog color1 = new ColorDialog();
|
|
|
@@ -25,21 +25,28 @@ namespace demo2
|
|
|
private MenuItem menuItem3 = new MenuItem();
|
|
|
private MenuItem menuItem4 = new MenuItem();
|
|
|
private MenuItem menuItem5 = new MenuItem();
|
|
|
-
|
|
|
- private void InitializeWidgets()
|
|
|
- {
|
|
|
- button1.Location = new Point(150, 28);
|
|
|
- button1.Name = "button1";
|
|
|
- button1.Size = new Size(128, 44);
|
|
|
- button1.Text = "Color";
|
|
|
- button1.Click += new EventHandler(this.button1_Click);
|
|
|
+ private StatusBar statusBar1 = new StatusBar();
|
|
|
+
|
|
|
+ private void InitializeWidgets()
|
|
|
+ {
|
|
|
+ this.statusBar1.Location = new System.Drawing.Point(0, 251);
|
|
|
+ this.statusBar1.Name = "statusBar1";
|
|
|
+ this.statusBar1.Size = new System.Drawing.Size(292, 22);
|
|
|
+ this.statusBar1.TabIndex = 0;
|
|
|
+ this.statusBar1.Text = "statusBar1";
|
|
|
+
|
|
|
+ button1.Location = new Point(150, 28);
|
|
|
+ button1.Name = "button1";
|
|
|
+ button1.Size = new Size(128, 44);
|
|
|
+ button1.Text = "Color";
|
|
|
+ button1.Click += new EventHandler(this.button1_Click);
|
|
|
button1.Enabled = true;
|
|
|
|
|
|
- button2.Location = new Point(150, 80);
|
|
|
- button2.Name = "button2";
|
|
|
- button2.Size = new Size(128, 44);
|
|
|
- button2.Text = "Add to ComboBox";
|
|
|
- button2.Click += new EventHandler(this.button2_Click);
|
|
|
+ button2.Location = new Point(150, 80);
|
|
|
+ button2.Name = "button2";
|
|
|
+ button2.Size = new Size(128, 44);
|
|
|
+ button2.Text = "Add to ComboBox";
|
|
|
+ button2.Click += new EventHandler(this.button2_Click);
|
|
|
button2.Enabled = true;
|
|
|
|
|
|
menuItem1.Text = "File";
|
|
|
@@ -68,25 +75,26 @@ namespace demo2
|
|
|
this.button1,
|
|
|
this.button2,
|
|
|
this.color1,
|
|
|
- this.combo1});
|
|
|
-
|
|
|
+ this.combo1,
|
|
|
+ this.statusBar1});
|
|
|
+
|
|
|
this.Size = new Size(512, 250);
|
|
|
- this.Menu = mainMenu1;
|
|
|
- }
|
|
|
-
|
|
|
- public GtkForm()
|
|
|
- {
|
|
|
+ this.Menu = mainMenu1;
|
|
|
+ }
|
|
|
+
|
|
|
+ public GtkForm()
|
|
|
+ {
|
|
|
InitializeWidgets();
|
|
|
- }
|
|
|
-
|
|
|
+ }
|
|
|
+
|
|
|
private void button1_Click(object sender, EventArgs e){
|
|
|
- color1.ShowDialog();
|
|
|
+ color1.ShowDialog();
|
|
|
}
|
|
|
|
|
|
private void button2_Click(object sender, EventArgs e){
|
|
|
combo1.BeginUpdate();
|
|
|
for (int i = 1; i < 5; i++) {combo1.Items.Add("Joel");}
|
|
|
- combo1.EndUpdate();
|
|
|
+ combo1.EndUpdate();
|
|
|
}
|
|
|
private void menuItem2_Click (object sender, EventArgs e){
|
|
|
MessageBox.Show("You clicked Exit");
|
|
|
@@ -97,14 +105,15 @@ namespace demo2
|
|
|
}
|
|
|
|
|
|
}
|
|
|
-
|
|
|
- public class GtkMain
|
|
|
- {
|
|
|
- public static void Main()
|
|
|
- {
|
|
|
- GtkForm form1 = new GtkForm ();
|
|
|
- form1.Text = "System.Windows.Forms at work!";
|
|
|
- Application.Run(form1);
|
|
|
- }
|
|
|
- }
|
|
|
+
|
|
|
+ public class GtkMain
|
|
|
+ {
|
|
|
+ [STAThread]
|
|
|
+ public static void Main()
|
|
|
+ {
|
|
|
+ GtkForm form1 = new GtkForm ();
|
|
|
+ form1.Text = "System.Windows.Forms at work!";
|
|
|
+ Application.Run(form1);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|