Windows form designer generated code VB


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Windows form designer generated code VB

  1. #1
    Join Date
    Feb 2006
    Posts
    133

    Question Windows form designer generated code VB

    Hello,

    I hope this question is quite simple to answer. I'll try to explain the problem as good as I can.

    I've had an introductin course to VB.net, the version was 2003. In this course they showed me when you create a windows form, VB automatically generates some code to create the form, something like this:

    Code:
    Public class Form1
      Inherits from System.Windows.forms.form
      
    #Region " Windows Form Designer generated code "
    
     Public sub New()
       Mybase.new()
    
       'This call is required by the windows form designer.
       InitializeComponent()
    
    .......
    
    end class
    I'm sure this is familiar to you all.

    Now I've purchased myself the visual studio 2005 professional edition and installed it. I've started the application, made a new project with VB and added a form. When I double click the form, I don't find the above code anywhere??? How does this come? Is it an option that I have to turn on/off or is this code deleted in the VS2005? Can somebody explain what's happening, because I'm a little confused.

    Thanks.
    Benjamin

  2. #2
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    .NET 2.0 adds a feature called "partial classes," which allows a single class to be defined across multiple source files. Rather than including the designer-generated code in your form file, VB 2005 puts it in a partial class in a file named Form1.Designer.vb.

    If you select Project -> Show All Files and then click the little plus sign next to your form in the Solution Explorer, you'll see the Designer file and can open it in Visual Studio.
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

  3. #3
    Join Date
    Feb 2006
    Posts
    133
    Thanks Phil, this is what I was looking for.
    Benjamin

Similar Threads

  1. Replies: 7
    Last Post: 10-28-2002, 12:10 PM
  2. .NET equals Efficiency
    By Kevin in forum .NET
    Replies: 150
    Last Post: 03-04-2002, 05:40 PM
  3. Replies: 90
    Last Post: 04-17-2001, 12:45 AM
  4. VB Forms Calling C++ Code
    By Lawrence Brabham in forum authorevents.morrison
    Replies: 1
    Last Post: 11-13-2000, 10:28 PM
  5. Aivosto VB Watch profiles code
    By Aivosto in forum vb.announcements
    Replies: 0
    Last Post: 09-25-2000, 02:02 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center