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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IDE Code display question

Status
Not open for further replies.

Andrzejek

Programmer
Jan 10, 2006
8,558
US

New to VB.NET 2010, mostly working in VB 6.0

In early VB.NET 2002, code and designer code were displayed in the same window. Then MicroSoft split it and you can just see your code.

Now in my 2010 when I code, I can see both again: designer code and my code in the same window:

Code:
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class frmGIS
    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
...
    Friend WithEvents radPoint As System.Windows.Forms.RadioButton
    Friend WithEvents radLine As System.Windows.Forms.RadioButton
    Friend WithEvents Label29 As System.Windows.Forms.Label
[blue]
    Private Sub frmGIS_Load(ByVal sender As System.Object, _
                            ByVal e As System.EventArgs) _
                        Handles MyBase.Load
End Sub[/blue]

Where black code is designer (is that what you call it?) and blue code is mine.

Is there a setting in VB.NET 2010 so I can see just my code and not designer code?

Have fun.

---- Andy
 

I don't know if 2010 does this, but the designer code used to be in a #Region called "Windows Forms Designer Generated Code" (or something like that). If that is not the case anymore, you can still create a #Region yourself and move all the code into there, then collapse it.


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!
 

Thank you jebenson, I know about the Regions, but I am looking for a setting that would do that for all code in VB.NET 2010. You know, the safety net, because I don't want to mees with designer code (if I don't have to....)

Have fun.

---- Andy
 

After digging around I found out that I put my code in the Designer part. For some reason my code did not go into vb part. I moved it around and now it is in the right place and I have my code separated from Designer code. I guess I have to be more careful when starting the Projects and make sure my code goes where is it supposed to go.

Have fun.

---- Andy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top