SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    Non-Member shivanee's Avatar
    Join Date
    May 2007
    Posts
    86
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    how to make the form as the start up page in c# winforms.

    Hello all,

    I want to set the start page from the project other than the default page in the project using the c# winforms.

    For ex:

    I am having one project in the solution in c# winforms 2003.When I add the new project to the solution,by default it adds one form in the project.

    Now I have more than one form in the project and I want to run other form instead of default form. So, in vb.net winforms,I can set the start page by right clicking on the project name--> Property--> and set the form name which you want to run first.

    But, in c# winform , it does not show this facility.So, how can I set the start page in the project other than the default page in winforms.We can set only the "startup Project" in the C# winforms.

    Please help me out.

    Thanks in advance.

  2. #2
    SitePoint Addict
    Join Date
    Aug 2007
    Location
    GR
    Posts
    352
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Find the main entry point if the application and change the line

    Application.Run(new Form1());

    to init the other form

  3. #3
    Non-Member shivanee's Avatar
    Join Date
    May 2007
    Posts
    86
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello
    Thanks for the reply.

    Means, If I am having 2 forms in the project. And both the forms having the main entry points.Now, if I run the first form , then after 1st form 2nd form will get run automatically if I dont use any method as showdialog() or show().

    i.e immidiately after the process of first form completes whithout doing anything.

    Because I want to combine 2 projects in the same solution. At present they are different in one solution only.But,when the first project(contains 2 to 3 forms) gets run and completes its process,then immidiately after the first project,second project(contains 2 to 3 forms) runs. In both the projects , the default forms has the main entry points and the other forms are getting run internally means by using showdialog() method.

    Do,you have any soln. over this or any other suggestion to combine 2 projects.Because I want the same functionality after combining the 2 projects in one solution.

    Right now I am having 2 exes of 2 projects which are getting run simuteneously.Now I want to combine means,I want to make only one exe instead of 2 exes.

    Thanks in advance.

  4. #4
    SitePoint Addict
    Join Date
    Aug 2007
    Location
    GR
    Posts
    352
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm not following you.

  5. #5
    Non-Member shivanee's Avatar
    Join Date
    May 2007
    Posts
    86
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    I am two projects and one class library in one solution.The class library is shared by both the projects.

    Suppose,

    I am having windowsApplication1 and windowsApplication2 in the same solution. Both the projects is having the 2 to 3 forms each including the default forms. These default forms having the main entry points,right.

    Now I made windowsApplication1 as StartUp Project.Now it will run the default form which is having the main entry point.Now remaining forms from this project get run internally from the default form. When the windowsApplication 1 gets run completely,then automatically it runs the windowsApplication2 with its default form.


    Now after combining both the projects,it should work as same as I have explained above.And I want to give the options whether the winApp1 will run first or winApp2 runs first.

    The project does not allow two main entry points.It gives the error,because I have tried it.

    Now, Have you got my problem?Please tell me the solution,if you are getting me.

  6. #6
    SitePoint Addict
    Join Date
    Aug 2007
    Location
    GR
    Posts
    352
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Then when the first app runs you add code and decide if it's the 2nd app that will run first you hide the one that has the main entry point and start the other.
    There is a function in the framework that executes programs.

  7. #7
    Non-Member shivanee's Avatar
    Join Date
    May 2007
    Posts
    86
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hi,
    Can I use showdialog() method by making the object of other form and hides the first one.Whether it will work or not? Or can you tell me that function please which executes the program.

    Thanks in advance.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •