We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you a podcast all about Citrix Workspace, moving to the cloud, and analytics & intelligence. Episode 2 coming soon!Listen Now


Upgrading from VB6 to V2005

AlHal2 asked
Medium Priority
Last Modified: 2013-11-13
I asked a question today about VB Express 2005 vs the professional version.  That question was:

I'm a VB6 programmer and want to learn VB 2005.  I have a CD with VB 2005 express.  Is it worth practising on Express or should I fork out for the professional Edition?
My next question is:

What can I do in Vb 2005 that I can't do in Vb6.  In VB6 I already have bits of code that I reuse as needed.  What practical difference can it make e.g. better API calls, a sorting algorithm, more functions for working with strings and dates...?
Watch Question

1) with .NET, you should not need ANY API calls, except possibly to third party libraries - ALl of eht Microsoft APIs are already built into  the .NET Framework.

2)  You will find that it is not so much what you can do with .NET that you can't do with VB^, but rather that the way you do it in .NET is many times VERY VERY different - you will need to re-learn a lot of what you have been doing with VB6.
   a) EVERYTING, repeat, EVERYTHING in .NET is an object, and thus has Properties and Methods.

       for example, a variable declared as String has a Replace METHOD, which serves to completely 'replace' the VB6 Replace FUNCTION:

      Dim MyString as String = "This is MY string"

      MyString.Replace ("MY", "John's")

      MyString now is "This is John's string"

     Integer variables have a ToString method, which can serve to format the resulting String (thus replacing the VB6 Format FUNCTION)

     Dim MyInt as Integer = 12345;

     MessageBox.Show( "The Value is " & MyInt.ToString("#,##0"))

(this could also be doe as :

     MessageBox.Show("The Value is {0,"#,##0}", MyInt)

Notice the NEW MessageBox function in .NET - which replaces the VB6 MsgBox.

These are just a few of the significant differences.

Please do yourself a BIG favor, and do NOT attempt to 'upgrade' your existing VB 6 code to .NET, using the UPGRADE Wizard - you will create far more work for yourself, trying to fix the 'errors' that will be reported with the 'upgrade' , which will require far more time to fix, that you would spend, re-wrtiting the functionality of the VB6 code, in 'proper' .NET, to begin with.  

I would strongly advise you to forget EVERYTHING - well, almost EVERYTHING, since the Syntax of VB.NET is quite similar to the Syntax of VB.NET, but that is about as far as the similarities go - that you ever thought you knew about VB, because the sooner you do that, and adapt to the VB.NET way of doing things, the better.  VB.NET is a PURE Object Oriented language, where VB6 was 'Object Based' - and there is a huge differencve between them, simply because of that distinction.  VB.NET is not simply a 'better' version of VB6.  It is a completely DIFFERENT animal.


Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
In general, .NET versions of Visual Basic (2002, 2003, 2005), have the following advantages over VB 6.0:

1. A *very* rich class library (the same class library accessible from C# and C++ .NET).
2. Direct interoperability with components created using other .NET languages.
3. Enhanced versions of components/technologies (such as ADO .NET and ASP .NET).
4. Portability to other platforms running the .NET Framework (other Windows/non-Windows operating systems, Pocket PC's, etc...). Porting the .NET Framework to non-Windows operating systems has not been achieved yet.
5. You get the full-featured compiler for free (it gets installed with the .NET Framework). Visual Studio 2005 even has free versions of the IDE's (Express Editions).

As for your other question, the Express Edition is just a limited "Integrated Development Environment". It provides less development "facilities" (yet already very powerful) than other versions of Visual Studio. However, the compiler is the same, and the available laguage API's are also the same, etc...

In brief, you can develop powerful VB .NET applications using the Notepad, and the command line compiler!! So take advantage of the freely available Express Edition to explore the .NET environment.


  Nayer Naguib
I suggest that you take a while writing miscellaneous VB .NET applications before you start upgrading your VB 6.0 code to VB .NET. Although both are *very* easy to program, you need to be familiar with .NET programming before you start upgrading your old code. This is because you will not be modifying your code on a line-by-line basis. For example, you may have 10's of lines of VB 6.0 code that would be translated to a single method call to an object of some existing class in the .NET Framework Class Library.


  Nayer Naguib
The .NET Framework does *not* encapsulate *every* existing Win32 API call, just the most frequently used by programmers.
For example, to set the transparency of a form in .NET, you just write something like this:

  myForm.Opacity=0.x 'where x is the percentage of opacity

But to register your application as an application desktop toolbar (a form that will dock to some edge of the screen and shrink the desktop), you still need to call Windows API's.


  Nayer Naguib
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.