473,405 Members | 2,404 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

user-defined types?

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?

Nov 21 '05 #1
2 2518
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?
|
Nov 21 '05 #2
"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?


For creating User-Defined types :
In VB6 you had Types and Classes.
Now, you have Structures and Classes.

If at all possible (and in /either/ language), I'd suggest using
Classes exclusively - they're just easier to get on with ...

HTH,
Phill W.
Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

60
by: Fotios | last post by:
Hi guys, I have put together a flexible client-side user agent detector (written in js). I thought that some of you may find it useful. Code is here: http://fotios.cc/software/ua_detect.htm ...
3
by: zlst | last post by:
Many technological innovations rely upon User Interface Design to elevate their technical complexity to a usable product. Technology alone may not win user acceptance and subsequent marketability....
6
by: martin | last post by:
Hi, I am a web page and a web user control. My web user control is placed in my web page using the following directive <%@ Register TagPrefix="uc1" TagName="Header"...
1
by: Shourie | last post by:
I've noticed that none of the child controls events are firing for the first time from the dynamic user control. Here is the event cycle. 1) MainPage_load 2) User control1_Load user clicks a...
7
by: jsale | last post by:
I'm currently using ASP.NET with VS2003 and SQL Server 2003. The ASP.NET app i have made is running on IIS v6 and consists of a number of pages that allow the user to read information from the...
0
by: tony | last post by:
Hello! This is a rather long mail but it's a very interesting one. I hope you read it. I have tried several times to get an answer to this mail but I have not get any answer saying something...
2
by: rn5a | last post by:
Assume that a user control (MyUC.ascx) encapsulates 2 TextBoxes with the IDs 'txt1' & 'txt2' respectively. To use this user control in an ASPX page, the following Register directive will be...
1
by: Carlettus | last post by:
Dear All, sorry but I'm not sure if this is the right place to post my problem. I was using the following asp code to create users in Active Directory. Suddenly, and I don't know the reason, users...
0
by: rbukkara | last post by:
Hi, I have got the following error while trying to add a user in the LDAP Directory. javax.naming.NameNotFoundException: ; remaining name 'uid=vassila,ou=People,dc=cs,dc=uno,dc=edu' I have...
9
by: Gordon | last post by:
I want to add a feature to a project I'm working on where i have multiple users set up on my Postgres database with varying levels of access. At the bare minimum there will be a login user who...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.