Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB 2008 Express Windows Form Designer code

Status
Not open for further replies.

jadams0173

Technical User
Feb 18, 2005
1,210
For some reason the auto generated code is showing up in my code window. Is there a way to turn this off so I can't see it? This is an example of what I see now. I don't know what made it start being visible.

Code:
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class frmMain
    Inherits System.Windows.Forms.Form

    'Form overrides dispose to clean up the component list.
    <System.Diagnostics.DebuggerNonUserCode()> _
    Protected Overrides Sub Dispose(ByVal disposing As Boolean)
        Try
            If disposing AndAlso components IsNot Nothing Then
                components.Dispose()
            End If
        Finally
            MyBase.Dispose(disposing)
        End Try
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    <System.Diagnostics.DebuggerStepThrough()> _
    Private Sub InitializeComponent()
        Me.lstColor = New System.Windows.Forms.CheckedListBox
        Me.grpSwim = New System.Windows.Forms.GroupBox
        Me.radNo = New System.Windows.Forms.RadioButton
        Me.radYes = New System.Windows.Forms.RadioButton
        Me.cboNoise = New System.Windows.Forms.ComboBox
        Me.Label1 = New System.Windows.Forms.Label
        Me.Label2 = New System.Windows.Forms.Label
 

The auto generated code is placed in a file called <formname>.Designer.vb. If you are seeing this code, it means you have opened this file. Just close the <formname>.Designer.vb file and you won't see that code anymore.



I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson

Arrrr, mateys! Ye needs ta be preparin' yerselves fer Talk Like a Pirate Day!
 
To further what jebenson is saying, you shouldn't be coding in the auto generated code window. You would want to right click on the <formname>.vb file and select "View Code".

-I hate Microsoft!
-Forever and always forward.
-My kingdom for a edit button!
 
Thanks for the replies. That's what I thought, but when I double click a button to write code behind it, the frmMain.designer.vb is what opens with all the auto generated code and my button events at the bottom. the frmMain.vb file is blank?
 
Yes, by default it is blank. I don't know why double clicking a button caused that when I do it opens the form.vb code.

-I hate Microsoft!
-Forever and always forward.
-My kingdom for a edit button!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top