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. Visual Basic
  4. Sub Main?

Sub Main?

Scheduled Pinned Locked Moved Visual Basic
helpquestion
7 Posts 5 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.
  • A Offline
    A Offline
    Anonymous
    wrote on last edited by
    #1

    Every time that I make a new project it has an error it says sub main not found. can someone help me figure this out cause it's really torqin' me off. Any suggestions or an answer to my problems would be much appreciated! Sam

    C J G 3 Replies Last reply
    0
    • A Anonymous

      Every time that I make a new project it has an error it says sub main not found. can someone help me figure this out cause it's really torqin' me off. Any suggestions or an answer to my problems would be much appreciated! Sam

      C Offline
      C Offline
      Charlie Williams
      wrote on last edited by
      #2

      Is the problem that you have a Sub Main and you're still getting the message or that you want to know why you need a Sub Main? Charlie if(!curlies){ return; }

      1 Reply Last reply
      0
      • A Anonymous

        Every time that I make a new project it has an error it says sub main not found. can someone help me figure this out cause it's really torqin' me off. Any suggestions or an answer to my problems would be much appreciated! Sam

        J Offline
        J Offline
        John Kuhn
        wrote on last edited by
        #3

        In a new VB.NET Windows Form project, if you remove the original Form1.vb and create a new form or main module, when you compile that project, it will tell you something like "Sub Main was not found in ProjectName.NewForm". Right-click on the project, click properties, then Common Properties, General, Startup Object, choose which thing will be your entry point for the application. In VB.NET, this will either be a Sub Main of a module or class, or a Form. What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.

        D 1 Reply Last reply
        0
        • J John Kuhn

          In a new VB.NET Windows Form project, if you remove the original Form1.vb and create a new form or main module, when you compile that project, it will tell you something like "Sub Main was not found in ProjectName.NewForm". Right-click on the project, click properties, then Common Properties, General, Startup Object, choose which thing will be your entry point for the application. In VB.NET, this will either be a Sub Main of a module or class, or a Form. What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          The problem comes in because you either removed the Form1 object, deleted the file like you said in your previous post, or you renamed Form1 improperly. When you did this, the Startup Object automatically reverted to Sub Main, even if you don't have one, since you don't have a valid startup form any more. Then when you created a new form, the Startup Object stayed as Sub Main and won't revert back to a valid form automatically. RageInTheMachine9532

          J 1 Reply Last reply
          0
          • D Dave Kreskowiak

            The problem comes in because you either removed the Form1 object, deleted the file like you said in your previous post, or you renamed Form1 improperly. When you did this, the Startup Object automatically reverted to Sub Main, even if you don't have one, since you don't have a valid startup form any more. Then when you created a new form, the Startup Object stayed as Sub Main and won't revert back to a valid form automatically. RageInTheMachine9532

            J Offline
            J Offline
            John Kuhn
            wrote on last edited by
            #5

            Dave, Did you mean to reply to the original poster? I thought my post read like an explanation... JAK What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.

            D 1 Reply Last reply
            0
            • J John Kuhn

              Dave, Did you mean to reply to the original poster? I thought my post read like an explanation... JAK What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.

              D Offline
              D Offline
              Dave Kreskowiak
              wrote on last edited by
              #6

              Sorry! :eek: It was meant for the original poster! :doh: RageInTheMachine9532

              1 Reply Last reply
              0
              • A Anonymous

                Every time that I make a new project it has an error it says sub main not found. can someone help me figure this out cause it's really torqin' me off. Any suggestions or an answer to my problems would be much appreciated! Sam

                G Offline
                G Offline
                gpa2000
                wrote on last edited by
                #7

                Why not change the startup module in your project properties? grtz, Guus

                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