a strange problem about win form

G

Guest

Hello everybody,
I have a windows application which made by C# of Visual Studio.NET 2003. But
the main form will be hided when the application load. Normally, the main
form loaded by following sentence:

Application.Run(new NameSpace1.Ui.MainForm());

Now, I make the system begining like following:

public class MainClass : System.Windows.Forms.ApplicationContext
{
[STAThread]
static void Main()
{
Application.Run(new NameSpace1.MainForm());
}

public MainClass()
{
Xuts.AlarmColock.UI.MainForm mf = new NameSpace1.Ui.MainForm();
mf.Hide();
mf.sysNotifyIcon.Visible = true;
}
}

It's going all right. But I still get a problem. Sometimes, a mode dialog
which load by the main form or sub form of it will cause a system error. Just
sometimes. Any body has any idea about that?
 
G

Guest

Sorry, Somewhere wrong in the Constructor of MainClass. NOT:

Xuts.AlarmColock.UI.MainForm mf = new NameSpace1.Ui.MainForm();

Should be:

NameSpace1.Ui.MainForm mf = new NameSpace1.Ui.MainForm();
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top