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
  1. Home
  2. General Programming
  3. C#
  4. Application.Run(new Form1()); Error Code

Application.Run(new Form1()); Error Code

Scheduled Pinned Locked Moved C#
csharphelpquestion
3 Posts 2 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.
  • B Offline
    B Offline
    Blekk
    wrote on last edited by
    #1

    Ok, I was just debugging my little web browser app I was creating and before Form1 even loads, I get the litte yellow highlight over this text: Application.Run(new Form1()); With this message: "Starting a second message loop on a single thread is not a valid operation. Use Form.ShowDialog instead." This is in Program.cs, I am new to C# and so do not really understand what the error is, I haven't changed anything in Program.cs atall, just the regular Form.cs Can somebody please tell me what the hell it is trying to tell me? Thanks, Any reply is appreciated.

    J 1 Reply Last reply
    0
    • B Blekk

      Ok, I was just debugging my little web browser app I was creating and before Form1 even loads, I get the litte yellow highlight over this text: Application.Run(new Form1()); With this message: "Starting a second message loop on a single thread is not a valid operation. Use Form.ShowDialog instead." This is in Program.cs, I am new to C# and so do not really understand what the error is, I haven't changed anything in Program.cs atall, just the regular Form.cs Can somebody please tell me what the hell it is trying to tell me? Thanks, Any reply is appreciated.

      J Offline
      J Offline
      Jon Hulatt
      wrote on last edited by
      #2

      Is your Form1 attempting to show another form somewhere using Application.Run() ??

      using System.Beer;

      B 1 Reply Last reply
      0
      • J Jon Hulatt

        Is your Form1 attempting to show another form somewhere using Application.Run() ??

        using System.Beer;

        B Offline
        B Offline
        Blekk
        wrote on last edited by
        #3

        Not atall, Form1 just contains a textbox and a menustrip so far with a File>New that creates a new instance of a class called File in Text.cs

        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