473,386 Members | 1,815 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

a strange problem about win form

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?
Aug 22 '06 #1
1 996
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();

"Steven.Xu" wrote:
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?
Aug 22 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Aaron Prohaska | last post by:
I have just run into a problem where I have a page that posts back to itself to execute code, except when the page does the post back it somehow executes code that is in our home page for the site....
4
by: Zhang Weiwu | last post by:
This is really very stange. I have a form like this: <form id="form_A"> xxxx </form> This form is on one page in a page of a web application, it is the only form on that page. on the end of...
1
by: Ian | last post by:
Hi, I have noticed some strange behaviour when loading my database. I load a menu form on startup; this form contains a linked image to display. If the project is not then signed, the menu form...
0
by: Kris Vanherck | last post by:
yesterday i started getting this strange error when i try to run my asp.net project: Compiler Error Message: CS0006: Metadata file 'c:\winnt\microsoft.net\framework\v1.1.4322\temporary asp.net...
5
by: Simon Verona | last post by:
I have a strange problem with a Windows Forms application. It installs and runs fine on my development machine but consistently comes up with errors on any installed machine. I get an error...
8
by: Spam Trap | last post by:
I am getting strange resizing problems when using an inherited form. Controls are moving themselves seemingly randomly, but reproducibly. "frmBase" is my base class (a windows form), and...
5
by: Ian | last post by:
Hi everyone, I have found some bizarre (to me...!) behaviour of the Form_Activate function. I have a form which has a button control used to close the form and a subform with a datasheet view...
2
by: teddysnips | last post by:
We've been supporting a number of Access applications for a particular client for some years. Some of them were written by third parties, some by us (even one or two by me, though not this...
0
by: Henrootje | last post by:
I have a problem which I do not understand........................ I have a split database. Tables in the backend on a networkdrive, all other in frontend placed in %temp% I have this form ...
4
by: navneet0909 | last post by:
hii, I have a strange problem while working on a MS Access db. The code is in VBA.. I have a main form A, and a button to call a subform B. now the form B has some lists which inserts data. That...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.