How to choose start class?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Diego F.

    How to choose start class?

    Hello. I have a windows forms application with one form. I added other class
    files too. By default, the applications starts in the form class, but I want
    it to start from other class. How can I do that?

    --

    Regards,

    Diego F.



  • Diego F.

    #2
    Re: How to choose start class?

    Ok, I found it. I can choose it from the project properties page. I had to
    uncheck 'Enable application framework' and then I can choose any file as
    startup object.

    --

    Regards,

    Diego F.


    "Diego F." <diego_frNO@msn .comwrote in message
    news:uw8yw%23Sm HHA.3996@TK2MSF TNGP06.phx.gbl. ..
    Hello. I have a windows forms application with one form. I added other
    class files too. By default, the applications starts in the form class,
    but I want it to start from other class. How can I do that?
    >
    --
    >
    Regards,
    >
    Diego F.
    >
    >
    >

    Comment

    • Robin Tucker

      #3
      Re: How to choose start class?

      Hi Diego,

      Right click the project and choose "properties ". On the application tab you
      should find a drop-down list to choose which form you want to set as the
      startup instance.



      Robin





      "Diego F." <diego_frNO@msn .comwrote in message
      news:uw8yw%23Sm HHA.3996@TK2MSF TNGP06.phx.gbl. ..
      Hello. I have a windows forms application with one form. I added other
      class files too. By default, the applications starts in the form class,
      but I want it to start from other class. How can I do that?
      >
      --
      >
      Regards,
      >
      Diego F.
      >
      >
      >

      Comment

      • Cor Ligthert [MVP]

        #4
        Re: How to choose start class?

        Diego,

        Be aware that you only can start from a module or a shared class (which is
        in fact a module)

        Cor

        "Diego F." <diego_frNO@msn .comschreef in bericht
        news:uw8yw%23Sm HHA.3996@TK2MSF TNGP06.phx.gbl. ..
        Hello. I have a windows forms application with one form. I added other
        class files too. By default, the applications starts in the form class,
        but I want it to start from other class. How can I do that?
        >
        --
        >
        Regards,
        >
        Diego F.
        >
        >
        >

        Comment

        • Herfried K. Wagner [MVP]

          #5
          Re: How to choose start class?

          "Cor Ligthert [MVP]" <notmyfirstname @planet.nlschri eb:
          Be aware that you only can start from a module or a shared class (which is
          in fact a module)
          ?!?

          VB.NET does not support shared classes (and no, I do not consider modules to
          be shared classes). However, the 'Main' method can be specified in a class
          if the *method* is marked as 'Shared'.

          --
          M S Herfried K. Wagner
          M V P <URL:http://dotnet.mvps.org/>
          V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

          Comment

          • Cor Ligthert [MVP]

            #6
            Re: How to choose start class?

            Yes you are right, however this is a newsgroup, not a documentation system.

            In this newsgroup I can find plenty of messages, as well from Herfried K.
            Wagner, where we talk about a shared class as the members are shared. And
            because of the fact that it is impossible to build a class in VB.Net with
            non shared public members a lot of us call that a shared class.

            Cor


            "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.atschr eef in bericht
            news:%23rNsPUYm HHA.4592@TK2MSF TNGP05.phx.gbl. ..
            "Cor Ligthert [MVP]" <notmyfirstname @planet.nlschri eb:
            >Be aware that you only can start from a module or a shared class (which
            >is in fact a module)
            >
            ?!?
            >
            VB.NET does not support shared classes (and no, I do not consider modules
            to be shared classes). However, the 'Main' method can be specified in a
            class if the *method* is marked as 'Shared'.
            >
            --
            M S Herfried K. Wagner
            M V P <URL:http://dotnet.mvps.org/>
            V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

            Comment

            • Herfried K. Wagner [MVP]

              #7
              Re: How to choose start class?

              "Cor Ligthert [MVP]" <notmyfirstname @planet.nlschri eb:
              Yes you are right, however this is a newsgroup, not a documentation
              system.
              >
              In this newsgroup I can find plenty of messages, as well from Herfried K.
              Wagner, where we talk about a shared class as the members are shared. And
              because of the fact that it is impossible to build a class in VB.Net with
              non shared public members a lot of us call that a shared class.
              I feel sorry, but I really do not understand the last sentence. VB.NET does
              not support the concept of a shared class for which the compiler enforces
              all members to be marked as 'Shared', as it is supported for static classes
              in C#.

              --
              M S Herfried K. Wagner
              M V P <URL:http://dotnet.mvps.org/>
              V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

              Comment

              • Cor Ligthert [MVP]

                #8
                Re: How to choose start class?

                VB.NET does not support the concept of a shared class for which the
                compiler enforces all members to be marked as 'Shared', as it is supported
                for static classes in C#.
                >
                See my 2 minutes later answered by you answered message too you.

                Cor


                Comment

                Working...