Solved

Opening Windows Application Form

Posted on 2006-11-25
2
225 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 62

Accepted Solution

by:
Fernando Soto earned 500 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

746 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now