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.
Now let's talk about some general information for the VB6 users, I think you'll find this useful. First of all if you are coming from a VB6 environment, you got to notice one of the fundamental differences between Visual Basic 6 and .NET is, .NET is assuming that you are in a disconnected environment. VB6 made an assumption that you are in close proximity to your data store or that it was on your same local area network, and as a result it passed parameters between methods by default, by reference and VB6 people know what this means. This means that anytime I passed a variable around, that each instance of that variable was pointing back to the actual location in memory. Which meant, if I changed this variable in any location, it actually changed the value of that variable that everyone saw. It also meant that anytime I changed that variable, I made a call across the network back to where that variable was stored. Now in .NET ByValue is the default, so anytime I change the value of a variable, I'm only changing that one instance of the value that I have of that variable of the time. So, you'll notice on our method that anytime we pass any kind of variables or our parameters between methods and functions, it goes by value as a default. Because we are assuming a disconnected environment here. This platform has matured incredibly for Visual Basic 6, we now have threading support. We can write applications that spawn and use multiple threads and that's kind of exciting; there is a vastly improved error handling here. Errors can't slip by like they use to, and we are using the tri-catch finally routine. You may have seen something similar in other languages, but this is a really nice. Visual Basic .NET is now truly object oriented; everything is an object and when I say everything I mean everything is an object. Want to show you an example in a minute of what I am talking about. But to do anything in .NET, we have to instantiate an object and set properties that are called methods. It's a very different from VB6. We have class inheritance, in a true form here. We don't have to go around the world and trick this thing into using abstract classes and multiple interfaces like we did in VB6, we have true class inheritance here. We can do method overriding, we'll talk about that a little bit later; we can inherit classes and pass the methods directly into our derived classes but then choose to override or do it a little bit different methods. Method overloading is really cool. Really new to the VB6 people. We can now call different signatures or methods that have the same name but take different parameters. So if I call one method using a string, it will execute properly but I can have another method with the same name that takes an integer as opposed to a string, and just by passing it an integer instead of a string will call the correct method. And this is called method overloading. Method shadowing - this is where we can do some tricks to make sure that we run a particular method based on how the classes are derived and so forth, we'll look at all this a little bit later. Right now I'm going to show you a form example in visual studio and show you that everything is indeed an object. So notice I've switched to the visual studio environment and notice that I'm starting with just a simple form. A windows application, nothing looks very drastic here. You know screens might look a little bit different, but look at my code: 'public class form1' - and I am actually instantiating a class to use my form. And notice this is the constructor for the class and you'll notice as we go down through here that the form itself is a class now. And so we are instantiating an example of this class. And let me go back and do something really quickly I'm going to add a button to this class, to this form, and you'll notice if we go back to the form now, that some things got written into our class for us, and notice that 'Button' set the properties of the name of the button, the tab index, the text that's on the front, and so we can programmatically see what's going on now. We didn't have that previously in Visual Basic. So that's some of the things under the hood that are different. We also picked up some really cool things that people from other languages have been really yelling for, for the past little while. And, that is the assignment short cuts. Whereas we used to, we had to write 'x=x+1' we can now say 'x+=1' This is a assignment short cut, this is the same as 'x = x+1'. We also have minus equals, times equals, and so we didn't pick all of them but we got a few. Arrays - arrays are now zero based in Visual Basic-6, you don't see the option array statement any more. All of our arrays start with zero; and something that is kind of weird - if I'm going to create an array that holds four variables, four pieces of information, and I deem it as an array, then I put the number three. And it looks like that you are holding three variables but again it's zero based. So it starts with zero, so you get zero, one, two, three - which is four. And we'll look at that again a little bit later, but those are just some of the basic changes VB6 users find most interesting. And I just wanted to point those out as we go forward. Now in the next set of videos we are going to shift gears and go to .NET Framework. And we are going to talk about exactly what this thing is, how to get it, how to install it, all kind of things.
| 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 |