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. How to avoid Designer.vb file ?

How to avoid Designer.vb file ?

Scheduled Pinned Locked Moved Visual Basic
csharpvisual-studiotutorialquestion
9 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.
  • M Offline
    M Offline
    Mahesh Sheka
    wrote on last edited by
    #1

    Can we exclude designer.vb file in windows applications using Visual studio 2005?

    D L 2 Replies Last reply
    0
    • M Mahesh Sheka

      Can we exclude designer.vb file in windows applications using Visual studio 2005?

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

      The designer files are just code to create the form and it's controls and lay them out on the form. Why would you want to execute just that file?? To answer you're question, no, you can't execute just the code in that file. All the files for the form are compiled into a single object that has no idea it was created from multiple files.

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
           2006, 2007, 2008
      But no longer in 2009...

      P 1 Reply Last reply
      0
      • M Mahesh Sheka

        Can we exclude designer.vb file in windows applications using Visual studio 2005?

        L Offline
        L Offline
        Luc Pattyn
        wrote on last edited by
        #3

        Hi, 1. when you create another kind of project (say a Console app) you wouldn't get a designer file at all; you then can edit and add Windows.Forms code (or any other code) to the files you do get. That excludes designer support of course. Also, you can copy-paste the designer code from where it is to where you prefer it to be, then remove the designer file. The designer may or may not still work for you then (I do it sometimes in C#, I have no experience doing this in VB.NET). :)

        Luc Pattyn [Forum Guidelines] [My Articles]


        The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Show formatted code inside PRE tags, and give clear symptoms when describing a problem.


        D 1 Reply Last reply
        0
        • L Luc Pattyn

          Hi, 1. when you create another kind of project (say a Console app) you wouldn't get a designer file at all; you then can edit and add Windows.Forms code (or any other code) to the files you do get. That excludes designer support of course. Also, you can copy-paste the designer code from where it is to where you prefer it to be, then remove the designer file. The designer may or may not still work for you then (I do it sometimes in C#, I have no experience doing this in VB.NET). :)

          Luc Pattyn [Forum Guidelines] [My Articles]


          The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Show formatted code inside PRE tags, and give clear symptoms when describing a problem.


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

          Luc Pattyn wrote:

          Also, you can copy-paste the designer code from where it is to where you prefer it to be, then remove the designer file. The designer may or may not still work for you then (I do it sometimes in C#, I have no experience doing this in VB.NET).

          The last time I tried this, it broke the designer. Though, I can't rememer if it was VS2003 or VS2005.

          A guide to posting questions on CodeProject[^]
          Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
               2006, 2007, 2008
          But no longer in 2009...

          L 1 Reply Last reply
          0
          • D Dave Kreskowiak

            Luc Pattyn wrote:

            Also, you can copy-paste the designer code from where it is to where you prefer it to be, then remove the designer file. The designer may or may not still work for you then (I do it sometimes in C#, I have no experience doing this in VB.NET).

            The last time I tried this, it broke the designer. Though, I can't rememer if it was VS2003 or VS2005.

            A guide to posting questions on CodeProject[^]
            Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                 2006, 2007, 2008
            But no longer in 2009...

            L Offline
            L Offline
            Luc Pattyn
            wrote on last edited by
            #5

            Hi Dave, I just finished this[^] test app using VS C# 2008 Express; with the InitializeComponent() stuff inside the main file, all works well, the designer locates and keeps updating its code just like older VS versions used to do. :)

            Luc Pattyn [Forum Guidelines] [My Articles]


            The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Show formatted code inside PRE tags, and give clear symptoms when describing a problem.


            D H 2 Replies Last reply
            0
            • L Luc Pattyn

              Hi Dave, I just finished this[^] test app using VS C# 2008 Express; with the InitializeComponent() stuff inside the main file, all works well, the designer locates and keeps updating its code just like older VS versions used to do. :)

              Luc Pattyn [Forum Guidelines] [My Articles]


              The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Show formatted code inside PRE tags, and give clear symptoms when describing a problem.


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

              Cool. I never tried in in 2008. I don't have it installed anywhere at work yet. :(

              A guide to posting questions on CodeProject[^]
              Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                   2006, 2007, 2008
              But no longer in 2009...

              1 Reply Last reply
              0
              • L Luc Pattyn

                Hi Dave, I just finished this[^] test app using VS C# 2008 Express; with the InitializeComponent() stuff inside the main file, all works well, the designer locates and keeps updating its code just like older VS versions used to do. :)

                Luc Pattyn [Forum Guidelines] [My Articles]


                The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Show formatted code inside PRE tags, and give clear symptoms when describing a problem.


                H Offline
                H Offline
                Henry Minute
                wrote on last edited by
                #7

                Interesting! I spend a fair amount of time doing the opposite, converting .Net 1.0/1.1 code to have a designer.cs file, since I prefer that.

                Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

                L 1 Reply Last reply
                0
                • H Henry Minute

                  Interesting! I spend a fair amount of time doing the opposite, converting .Net 1.0/1.1 code to have a designer.cs file, since I prefer that.

                  Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

                  L Offline
                  L Offline
                  Luc Pattyn
                  wrote on last edited by
                  #8

                  So did I, when switching away from older .NET and VS versions. However for very small projects (less than 100 lines of code) I prefer having it all in 1 file. BTW: this may interest you, long ago, working in Fortran under RSX11D/RSX11M/old versions of VMS, I used to put build commands at the top of my FTN sources, starting with a 'C' of course; and I had a small utility to invoke compiler, linker, and then run the program. So the entire project was 1 file, which built and ran automatically. :)

                  Luc Pattyn [Forum Guidelines] [My Articles]


                  The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Show formatted code inside PRE tags, and give clear symptoms when describing a problem.


                  1 Reply Last reply
                  0
                  • D Dave Kreskowiak

                    The designer files are just code to create the form and it's controls and lay them out on the form. Why would you want to execute just that file?? To answer you're question, no, you can't execute just the code in that file. All the files for the form are compiled into a single object that has no idea it was created from multiple files.

                    A guide to posting questions on CodeProject[^]
                    Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                         2006, 2007, 2008
                    But no longer in 2009...

                    P Offline
                    P Offline
                    PIEBALDconsult
                    wrote on last edited by
                    #9

                    He said "exclude", not "execute". (Or maybe he edited the post.)

                    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