Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Opening Windows Application Form

Posted on 2006-11-25
2
Medium Priority
?
232 Views
Last Modified: 2010-04-16
Hi,

I am making windows application making in C# and using .Net 2005

I have included refernce of some other project .exe made in .Net 2003 in my application

Now, I can access all methods and classes made in the .net2003 project.

Now I want to open the main form from my application

On the .Net Button click I am writting

private void button1_Click_2(object sender, EventArgs e)
        {
            MainScreen mscreen = new MainScreen();
            mscreen.Form1_Load(this, e);
}

But I am not able to open the form how can i do this.

This form is the main form of the application.

Thanks in Advance

Regards
0
Comment
Question by:dinesh_bali
2 Comments
 
LVL 64

Accepted Solution

by:
Fernando Soto earned 2000 total points
ID: 18011604
Hi dinesh_bali;

Try it this way.

private void button1_Click_2(object sender, EventArgs e)
{
        MainScreen mscreen = new MainScreen();
        mscreen.Show();
}


Fernando
0
 
LVL 44

Expert Comment

by:Arthur_Wood
ID: 18011944
and this coe:

Hi dinesh_bali;

Try it this way.

private void button1_Click_2(object sender, EventArgs e)
{
        MainScreen mscreen = new MainScreen();
        mscreen.Show();
}


will open the mscreen object for a very brief moment, then it will go out of scope, and disappear.

what are you trying to accomplish, using the command button?

AW
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses

782 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question