We will be undergoing scheduled maintenance on May 20th, 2013 at 02:00 GMT.
Visitors to VTC.com will be able to view all introductory videos for each training course.
Free Trial Members will gain access to first three chapters for each training course.
Full Access Members have full access to VTC.com�s entire library of video tutorials.
Creating shared members is a very simple straightforward process. Basically we are just going to add shared to the member declaration. So let's take a look at this. If I've got a member that's actually a subroutine, this is going to become a method. I'm going to type - Public Sub DoSomething () - then I'll put my code in my End sub. Now if I want this to become a shared member or a shared subroutine, I declare it as - Public Shared Sub DoSomething (). And this share word basically tips VB .NET off and allows this thing to be used without first instantiating an object. For declaring variables, notice instead of putting - Public X As Int16 - I put - Public Shared X As Int16. And again it makes this variable available to anyone without having to first create an instance of an object off of this class. Now I want to point out something here that you probably have been used to seeing, like - Dim X As Int16 - or for dimension to set up these variables. If you use a public or private key word then you can omit Dim: it becomes optional at that point. This is how you create these shared members. This is very straightforward, very simple.
| Course: | Microsoft Visual Basic .NET |
| Author: | Mark Long |
| SKU: | 33433 |
| ISBN: | 1932072349 |
| Release Date: | 2003-05-27 |
| Duration: | 6 hrs / 87 lessons |
| Captions: | No |
| Compatibility: |
Vista/XP/2000, OS X, Linux QuickTime 7, Flash 8 |