For my latest project, I got a chance to use Visual Studio 2008 to create a Windows application in the vb.net language. After learning my way around the interface, I was off and running at the speed of light.
My previous encounters with Visual Basic were with Visual Basic 6.0 and the VB macro editor that comes with built into Microsoft Office 2002. So I have hardly come to this with no experience, however it is true to say that without much effort and a quick tutorial, even beginners can achieve quite interesting things.
For those that aren’t familiar with it, VB.net is an evolution of the Visual Basic language created by Microsoft. It includes a whole new set of .net framework class libraries, as well as the most of the traditional class libraries. VB.net is used for both offline and online applications. For this article, I’m interested only in the traditional Windows “forms” application.
The Visual Editor:
As the name suggests, Visual Basic involves a visual component, which is the graphical forms editor. This allows you to add components to the forms space, such as buttons, text boxes, scroll bars, labels etc, and then you code in the interactions between these components. At the side of the editing area is a properties box, which lists all the various properties that dictate the behavior of those components.
Visual Studio functions much the same as Visual Basic 6.0 in regards to the visual editor.
When I first learnt to use Visual Basic, I picked it up very fast because it was more or less intuitive. What made it very easy to achieve things that I had not even learnt, but only imagined, was one of the program’s great features:
The Object Browser:
The object browser contains a browse-able list of class libraries that you can use. Looking through the list, you can get an idea of what can be achieved with Visual Basic, and can browse the syntax and required objects/parameters for various functions. It is important to note that some sub-classes and operations are not shown in the browser.
One of my more favourite features in Visual Studio (and its’ predecessors) is the drop down auto-complete list.
Visual Basic is an object oriented language, and the objects are elaborated through the . (dot). For example, to reference a parameter “height” of a text box named “txtBox”, we would refer to it as txtBox.height
The auto-complete list will pop up when I type the . (dot), and list all those properties that I may choose from. Height would be found within it, and have an icon that represents that it is a property.
Also found within the auto-complete list, are functions. These have different icons. Examples of these would be show(), hide(), close()
This makes for very easy coding. I can be guided along by the auto-complete without having learnt the ins and outs of the object with which i’m interacting.
As for user-friendliness as a whole, there is more complexity in Visual Studio than there was in Visual Basic 6.0. This has great advantages, but one disadvantage is that it is definitely less user-friendly than it once was, especially at compile time.
Builds can be debug or release, and there are versions and references that must be accounted for. All of this can be learnt fairly easily.
Releasing your software to the world:
Visual Studio has a publish option, that lets you publish a software installer. For me this process was counter-intuitive to my expectations, as most applications I have downloaded have been in standalone single install files, either msi or exe.
When you publish your application it will be placed in a folder with subdirectories that contain your application and its’ files.
The best way to publish with a standalone installer is to compile your application in the standard way, and then create a new project choosing the “installer package” template. This will create an msi installer into which you can add your executable and program files.
I didn’t find any good tutorials that go through this process from start to finish, so be prepared to spend some time searching the web for any answers you may have, and do plenty of testing if you wish to take this path.
Of course you can stick with the published installer.
Overall, Visual Studio 2008 and vb.net (with net framework 3.5) has plenty of great features and lots of class libraries to help you achieve what you want.
I haven’t even touched on the possibilities that arise from the online projects that can be created and managed with VS2008, so I’m sure there’ll be plenty more adventures for me in the years to come in the world of VB.net