Results 1 to 4 of 4

Thread: Question regarding the default breakdown of form code (designer, etc.)

  1. #1

    Thread Starter
    Member
    Join Date
    Apr 2006
    Posts
    56

    Question regarding the default breakdown of form code (designer, etc.)

    I noticed in some example files that the form.Designer code is embedded into the form's source code, rather than put as a shortcut of some sort inside the form (hard to explain, but I'm sure you know what I mean).

    Is there an option I can enable in VS2005 that does this by default? I like having the Designer code in the form's code, simply because it's 1 less open file in the IDE. I looked around everywhere with no luck.

    Is this just something that occured in previous versions of VS that they changed in 2005?

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Question regarding the default breakdown of form code (designer, etc.)

    No you can't. You shouldn't have the designer file open in the IDE anyway. There are some instances where you may need to edit the designer file by hand but they are very, VERY few and far between. The designer file is automatically regenerated each time you make changes in the designer so generally any changes you make there will be lost almost immediately anyway. The only valid reasons to have that file open are if you want to inspect the code to learn something or if the IDE has buggered something up and you need to change it in order to get your form back to working order. In the general day to day you shouldn't have anything to do with that file. Why do you have it open, by the way?
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Member
    Join Date
    Apr 2006
    Posts
    56

    Re: Question regarding the default breakdown of form code (designer, etc.)

    I don't keep it open.

    It's just annoying having to open another window, wait for it to load, and then hunt down whatever I was going in there to do when it could be avoided by placing the code in a region somewhere in the form's main code file.

    Most of the time the reason I go in there is if I manually deleted an event for a control. In and out in a few seconds usually, removing the reference to the event.

  4. #4
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Question regarding the default breakdown of form code (designer, etc.)

    That's the way VS 2005 is. Ideally, when you're coding, you shouldn't really need to be going into the designer anymore. That's one of the benefits of Partial Classes, they can place the designer code in another file. In fact, in ASP.NET, the 'designer' code is generated at runtime.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width