Author: pbartok
Date: 2005-05-25 23:49:41 -0400 (Wed, 25 May 2005)
New Revision: 45029
Added:
trunk/winforms/filedialog/
trunk/winforms/filedialog/Makefile
trunk/winforms/filedialog/swf-filedialog.cs
Log:
* Simple test app for FileDialog
Added: trunk/winforms/filedialog/Makefile
===================================================================
--- trunk/winforms/filedialog/Makefile 2005-05-26 03:15:59 UTC (rev 45028)
+++ trunk/winforms/filedialog/Makefile 2005-05-26 03:49:41 UTC (rev 45029)
@@ -0,0 +1,10 @@
+all: mono
+
+mono: swf-filedialog.cs
+ mcs swf-filedialog.cs /r:System.Windows.Forms.dll /r:System.Drawing.dll
+
+dotnet: swf-filedialog.cs
+ csc swf-filedialog.cs /r:System.Windows.Forms.dll /r:System.Drawing.dll
+
+clean:
+ rm swf-filedialog.exe -r -f
Added: trunk/winforms/filedialog/swf-filedialog.cs
===================================================================
--- trunk/winforms/filedialog/swf-filedialog.cs 2005-05-26 03:15:59 UTC (rev
45028)
+++ trunk/winforms/filedialog/swf-filedialog.cs 2005-05-26 03:49:41 UTC (rev
45029)
@@ -0,0 +1,51 @@
+//
+// Testapp by Alexander Olk
+//
+
+using System;
+using System.Drawing;
+using System.Windows.Forms;
+
+namespace testwin
+{
+ public class MainForm : Form
+ {
+ private Button button;
+ public MainForm()
+ {
+ button = new Button();
+ SuspendLayout();
+ button.Location = new System.Drawing.Point(40, 32);
+ button.Text = "FileDialog";
+ button.Click += new System.EventHandler(OnClick);
+ AutoScaleBaseSize = new Size(5, 13);
+ ClientSize = new System.Drawing.Size(292, 266);
+ Controls.Add(button);
+ Text = "FileDialogTest";
+ ResumeLayout(false);
+ }
+
+ [STAThread]
+ public static void Main(string[] args)
+ {
+ Application.Run(new MainForm());
+ }
+
+ void OnClick(object sender, System.EventArgs e)
+ {
+ OpenFileDialog myFileDialog = new OpenFileDialog();
+ myFileDialog.Filter = "All Files (*.*)|*.*";
+ myFileDialog.Multiselect = false;
+ myFileDialog.RestoreDirectory = false;
+ myFileDialog.ShowDialog();
+
+ if (myFileDialog.FileName.Trim() != string.Empty)
+ {
+ this.button.Text = myFileDialog.FileName.Trim();
+ }
+
+ myFileDialog.Dispose();
+ myFileDialog = null;
+ }
+ }
+}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches