Organize Code

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Daniel N

    #1

    Organize Code

    I am new to .net and want to organize my code better. I am writing in vb.net
    2003
    and the code for my main form is nearing 50-60 pages and would like to
    create another file like a class, module or code file that SHARE sub
    procedures, and declarations as if it were with the rest of the code (So I
    can orginize it in 2 or 3 .vb files).

    When I create a new class I can;

    Inherits Project.MainFor m


  • GhostInAK

    #2
    Re: Organize Code

    Hello Daniel,

    Not in 03. In 05 you can do this with partial classes.

    -Boo
    I am new to .net and want to organize my code better. I am writing in
    vb.net
    2003
    and the code for my main form is nearing 50-60 pages and would like to
    create another file like a class, module or code file that SHARE sub
    procedures, and declarations as if it were with the rest of the code
    (So I
    can orginize it in 2 or 3 .vb files).
    When I create a new class I can;
    >
    Inherits Project.MainFor m
    >

    Comment

    • Daniel N

      #3
      Re: Organize Code

      So how can I inherit subs and declarations into another vb file in 2003

      "GhostInAK" <ghostinak@gmai l.comwrote in message
      news:be1391bff1 2a8c877cd192061 d9@news.microso ft.com...
      Hello Daniel,
      >
      Not in 03. In 05 you can do this with partial classes.
      >
      -Boo
      >
      >I am new to .net and want to organize my code better. I am writing in
      >vb.net
      >2003
      >and the code for my main form is nearing 50-60 pages and would like to
      >create another file like a class, module or code file that SHARE sub
      >procedures, and declarations as if it were with the rest of the code
      >(So I
      >can orginize it in 2 or 3 .vb files).
      >When I create a new class I can;
      >>
      >Inherits Project.MainFor m
      >>
      >
      >

      Comment

      • Cor Ligthert [MVP]

        #4
        Re: Organize Code

        Daniel,

        Why are you throwing repeated messages in these newsgroups.

        I have seen a bunch of answers on your question at least in this newsgroup,
        where you are telling the same as now. The answers were all quiet different
        but a direct answer on your question.

        Cor

        "Daniel N" <saintdark_998@ yahoo.comschree f in bericht
        news:t1Uug.659$ mQ.582@fe12.lga ...
        >I am new to .net and want to organize my code better. I am writing in
        >vb.net 2003
        and the code for my main form is nearing 50-60 pages and would like to
        create another file like a class, module or code file that SHARE sub
        procedures, and declarations as if it were with the rest of the code (So I
        can orginize it in 2 or 3 .vb files).
        >
        When I create a new class I can;
        >
        Inherits Project.MainFor m
        >

        Comment

        • Izzy

          #5
          Re: Organize Code

          You can use: # Region " Name "
          To group code and make it easier to read. I group my code based on the
          codes function.

          Also you mentioned your new to vb.net, that might also be a reason your
          main form's code is 50 or 60 pages. Look through your code and try to
          write reusable code.


          Daniel N wrote:
          I am new to .net and want to organize my code better. I am writing in vb.net
          2003
          and the code for my main form is nearing 50-60 pages and would like to
          create another file like a class, module or code file that SHARE sub
          procedures, and declarations as if it were with the rest of the code (So I
          can orginize it in 2 or 3 .vb files).
          >
          When I create a new class I can;
          >
          Inherits Project.MainFor m

          Comment

          • Daniel N

            #6
            Re: Organize Code

            Thanks Izzy, this is EXACTLY what I was looking for.


            "Izzy" <israel.richner @gmail.comwrote in message
            news:1153227168 .440997.160180@ p79g2000cwp.goo glegroups.com.. .
            You can use: # Region " Name "
            To group code and make it easier to read. I group my code based on the
            codes function.
            >
            Also you mentioned your new to vb.net, that might also be a reason your
            main form's code is 50 or 60 pages. Look through your code and try to
            write reusable code.
            >
            >
            Daniel N wrote:
            >I am new to .net and want to organize my code better. I am writing in
            >vb.net
            >2003
            >and the code for my main form is nearing 50-60 pages and would like to
            >create another file like a class, module or code file that SHARE sub
            >procedures, and declarations as if it were with the rest of the code (So
            >I
            >can orginize it in 2 or 3 .vb files).
            >>
            >When I create a new class I can;
            >>
            >Inherits Project.MainFor m
            >

            Comment

            Working...