Class file formatting

mitchpetel

New member
Joined
Aug 24, 2006
Messages
3
Programming Experience
Beginner
I type the following into notepad and save as MyClass.vb. This class file works fine in any application I include it in but the nice colapsable/expandable Regions don't work. They are displayed but do not colapsable/expand. What am I missing ? Thanks in advance. Pete

VB.NET:
Imports System
Imports System.Data
Imports System.Data.OleDb
Imports System.Configuration
 
Public Class Areas
#Region "Members"
Private m_Action_ID As Long = 0
Private m_Goal_ID As Long = 0
Private m_ActionType_ID As Long = 0
#End Region
#Region "Properties"
Public Property Action_ID() As Long
Get
Return m_Action_ID
End Get
Set(ByVal Value As Long)
m_Action_ID = Value
End Set
End Property
Public Property Goal_ID() As Long
Get
Return m_Goal_ID
End Get
Set(ByVal Value As Long)
m_Goal_ID = Value
End Set
End Property
Public Property ActionType_ID() As Long
Get
Return m_ActionType_ID
End Get
Set(ByVal Value As Long)
m_ActionType_ID = Value
End Set
End Property
#End Region
End Class
 
These regions work fine when I test this, both for pasted in class and added existing vb file I saved from Notepad. (in last case looses the nice VS code editor formatting, though).
 
It's the same with VS2003, regions work both if you paste in the code or if you Add Existing file to your project. But now I see what you mean, if you just open the file in VS without adding it to any project the regions is not active in VS2003, in VS2005 they are. If you want code editor/intellisense features active you should add the class to the project.
 
I think this was intended. To open a file in 2003 it was, i assumned, only for purposes of viewing that file. It is not part of the project or solution, thats the reason you have the option to add existing item, or to just open a file. I actually found that quite useful when refering to code that i had previously written and wanted to have the file open in VS but not be part of the project.
 
I think this was intended. To open a file in 2003 it was, i assumned, only for purposes of viewing that file. It is not part of the project or solution, thats the reason you have the option to add existing item, or to just open a file. I actually found that quite useful when refering to code that i had previously written and wanted to have the file open in VS but not be part of the project.

ahh, i'm currently using notepad for that right now
 
Back
Top