Solved

Opening Windows Application Form

Posted on 2006-11-25
2
228 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 63

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

730 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