Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. Problem executing the Order of Forms..............pls help.

Problem executing the Order of Forms..............pls help.

Scheduled Pinned Locked Moved C#
helpwinformsquestion
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    Verghese
    wrote on last edited by
    #1

    I have 2 windows forms, lets say Form1 and Form2........after designing I came to knowe that Form2 should execute before Form1...........how can I do that........

    L A 2 Replies Last reply
    0
    • V Verghese

      I have 2 windows forms, lets say Form1 and Form2........after designing I came to knowe that Form2 should execute before Form1...........how can I do that........

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Depends on how the first form is created and displayed. Usually, if you create a simple Windows Forms application, then in your source file Program.cs you will find something like this:

      [STAThread]
      static void Main()
      {
      Application.EnableVisualStyles();
      Application.SetCompatibleTextRenderingDefault(false);
      Application.Run(new Form1());
      }

      There you can simply change new Form1() to new Form2() (or their correct form type name). regards

      V 1 Reply Last reply
      0
      • V Verghese

        I have 2 windows forms, lets say Form1 and Form2........after designing I came to knowe that Form2 should execute before Form1...........how can I do that........

        A Offline
        A Offline
        Abhijit Jana
        wrote on last edited by
        #3

        Hey just change in Program.Cs [STAThread] static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); **Application.Run(new Form2());** // Now you have Form1 Change it to Form2 }

        Best Regards ----------------- Abhijit Jana Check Out My Latest Article Java.NET : Integration of Java and .NET[^] "Success is Journey it's not a destination"

        1 Reply Last reply
        0
        • L Lost User

          Depends on how the first form is created and displayed. Usually, if you create a simple Windows Forms application, then in your source file Program.cs you will find something like this:

          [STAThread]
          static void Main()
          {
          Application.EnableVisualStyles();
          Application.SetCompatibleTextRenderingDefault(false);
          Application.Run(new Form1());
          }

          There you can simply change new Form1() to new Form2() (or their correct form type name). regards

          V Offline
          V Offline
          Verghese
          wrote on last edited by
          #4

          Thanks a lot.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups