From 590c26740109bdec3194add8cc92a9ef1eb278e6 Mon Sep 17 00:00:00 2001 From: Peter Dennis Bartok Date: Tue, 15 Feb 2005 07:41:59 +0000 Subject: [PATCH] - Simple app to bring up FontDialog svn path=/trunk/winforms/; revision=40676 --- fontdialog/Makefile | 10 ++++++++ fontdialog/swf-fontdialog.cs | 44 ++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 fontdialog/Makefile create mode 100644 fontdialog/swf-fontdialog.cs diff --git a/fontdialog/Makefile b/fontdialog/Makefile new file mode 100644 index 0000000..17c294f --- /dev/null +++ b/fontdialog/Makefile @@ -0,0 +1,10 @@ +all: mono + +mono: swf-fontdialog.cs + mcs swf-fontdialog.cs /r:System.Windows.Forms.dll /r:System.Drawing.dll + +dotnet: swf-fontdialog.cs + csc swf-fontdialog.cs /r:System.Windows.Forms.dll /r:System.Drawing.dll + +clean: + rm swf-fontdialog.exe -r -f diff --git a/fontdialog/swf-fontdialog.cs b/fontdialog/swf-fontdialog.cs new file mode 100644 index 0000000..1616b2e --- /dev/null +++ b/fontdialog/swf-fontdialog.cs @@ -0,0 +1,44 @@ +// +// Testapp by Alexander Olk +// + +using System; +using System.Drawing; +using System.Windows.Forms; + +namespace testwin +{ + public class MainForm : Form + { + private Button button; + private FontDialog fontDialog; + public MainForm() + { + fontDialog = new FontDialog(); + button = new Button(); + SuspendLayout(); + button.Location = new System.Drawing.Point(40, 32); + button.Text = "FontDialog"; + button.Click += new System.EventHandler(OnClick); + AutoScaleBaseSize = new Size(5, 13); + ClientSize = new System.Drawing.Size(292, 266); + Controls.Add(button); + Text = "FontDialogTest"; + ResumeLayout(false); + } + + [STAThread] + public static void Main(string[] args) + { + Application.Run(new MainForm()); + } + + void OnClick(object sender, System.EventArgs e) + { + if (DialogResult.OK == fontDialog.ShowDialog()) { + Console.WriteLine(fontDialog.Font); + Console.WriteLine(fontDialog.Color); + } + } + } +}