Les,
| In VB6 you had a Type and End Type to define your own data types.
Structure in VB.NET is the same as Type in VB6. Of course the advantage of
Structure over Type is that Structure can contain behavior (Function, Sub,
Property & Events) while Type could only contain fields.
Class & Enum in VB.NET are the same as Class & Enum in VB6.
| Are the only ways to do this in VB.Net with enums, struct and class.
No there is also Delegate for defining references to functions.
| How's the best way to define user defined types?
What type of Type are you wanting to define?
If I were defining an enumeration (a fixed set of values) I would use Enum
in either VB6 or VB.NET.
If I were defining a value type I would use Type in VB6 or Structure in
VB.NET. NOTE: A value type means a type that is stored "in-line" or on the
stack.
If I were defining a reference type I would use Class in either VB6 or
VB.NET.
http://msdn.microsoft.com/library/de...Guidelines.asp
Generally I use Class to define new types, however I will use Structure when
a type will have most or all of:
- act like primitive types
- have an instance size under 16 bytes
- are immutable
- value semantics are desirable
http://msdn.microsoft.com/library/de...Guidelines.asp
--
Hope this helps
Jay [MVP - Outlook]
T.S. Bradley -
http://www.tsbradley.net
"Les Stockton" <Le*********@discussions.microsoft.com> wrote in message
news:D8**********************************@microsof t.com...
| In VB6 you had a Type and End Type to define your own data types.
| Are the only ways to do this in VB.Net with enums, struct and class.
| How's the best way to define user defined types?
|