[Mono-list] Simple Window Form can not be showed in Solaris
Elliott Draper
el at eldiablo.co.uk
Thu Jul 28 09:44:10 EDT 2005
Huaiyang Mao wrote:
>Hello,
>
>I have installed mono 1.1.8.2 in Solaris and can compile the following
>code with "mcs -r:System.Windows.Forms Test.cs" successfully. I tried
>to start it "mono Test.exe", but I could not get the simple Windows
>Form showed. Could you help me to solve the problem? Many thanks.
>
>------------------------------------------------------------------------------------------------------------------
>using System;
>using System.Collections;
>using System.ComponentModel;
>
>namespace client
>{
> public class SimpleForm
> {
> private System.ComponentModel.Container components = null;
>
> [STAThread]
> static void Main()
> {
> Application.Run(new SimpleForm());
> }
>
> public SimpleForm()
> {
> }
> }
>}
>_______________________________________________
>Mono-list maillist - Mono-list at lists.ximian.com
>http://lists.ximian.com/mailman/listinfo/mono-list
>
>
>
Your almost there, you just need to make your "SimpleForm" class inherit
from a Windows form, by adding "using System.Windows.Forms;" to the
using declarations at the top, and then change the line
"public class SimpleForm"
to read:
"public class SimpleForm: Form"
This now means that your simple form class is derived from a Form, and
when the app is run, it will create and display your basic blank form.
Hope that helps,
Regards,
-= El =-
More information about the Mono-list
mailing list