Before discussing BASIC and Microsoft’s various versions of the language, I thought it would be fun to first examine how easy it is to recreate hello, world in Visual Basic, my favorite Microsoft entry. And as it turns out, it is perhaps too easy. In fact, you can recreate hello, world without writing any code at all.
This was true in 1990 with Visual Basic 1.0. And it’s still true today, as Visual Basic lives on in Visual Studio 2019, where it can be used to create Universal Windows Platform (UWP), Windows Presentation Foundation (WPF), and Windows Forms (WinForms) apps. From a code perspective, the version of Visual Basic one uses now is a far cry from the friendlier, earlier (pre-.NET) versions of the language. But since no code is really required, let’s first examine what a Hello, Visual Basic app looks like using the oldest of these still-supported technologies, WinForms.
After configuring the .NET desktop development workload in Visual Studio 2019, I created a new Windows Form App (.NET Framework) project. The resulting workspace is somewhat reminiscent of the early versions of Visual Basic, the primary difference being that the sub-windows are all grouped in the main Visual Studio main whereas classic Visual Basic versions—as you’ll soon see—used floating sub-windows.

To display the text “Hello, Visual Basic” in the application window—both in the title bar and on the window itself—all I needed to do was add a control called a label to the main application form (“window”) and then use the appropriate properties in the Properties window to set the text of each appropriately.
First, however, I needed to display the Toolbox window, a key feature of Visual Basic and its visual designers since the beginning.

This window provides a palette of Windows controls that you can add to the application form to build a user interface. And doing so is as easy as selecting a control and dragging it to the form. (You can also double-click any control to place it in the upper-left corner of the form.)

To change the title bar of the form to read “Hello, Visual Basic,” I simply selected the form itself and then found the Text property, which I changed to that text.

Similarly, to change the label to the same text, I selected that control, found its Text property, and changed that to “Hello, Visual Basic” as well. (I also changed the font size, using the Font property, to make the label a bit easier to see.

That’s it. Literally. When run, the app looks exactly like you think it should.

To be fair, we could also have done this with software code. To test this, I change the Text property for the form and the label to be blank. And then I double-clicked the form to access its Load function, which runs when the firm first loads (i.e. when the application starts
It looks like so.
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load End Sub
Visual Basic code, even in this newer, .NET-style, is fair readable. So, adding the text “Hello, Visual Basic” to the form and the label is as simple as adding the following code inside that Load function:
Me.Text = "Hello, Visual Basic" Label1.Text = Me.Text
The resulting application is identical to the version shown above.
And … that’s pretty fun, I guess. And while creating something similar using WPF or UWP is similar, I’m a bit more interested in the past. Could I recreate this using an older version of Visual Basic?
Well, obviously. It’s a really simple application. But how far back could I go without messing around with virtual machines and old Windows versions? The oldest version of Visual Basic that might possibly run on Windows 10, I figured, is Visual Basic 4. That version of Visual Basic was released in 1995 and it shipped in both 16-bit and 32-bit versions. (Visual Basic 1, 2, and 3 were 16-bit only.) You never know.
After finding a copy of Visual Basic 4, I installed it on Windows 10 using the compatibility troubleshooter to fake Setup into believing it was running on Windows XP with Service Pack 3.

Likewise, after encountering a startup error, I did the same for the Visual Basic application itself. Voila. It totally works. How beautiful is this?

Then, I set out to recreate Hello, Visual Basic using Visual Basic 4. As expected, it was easy. The no-code version works similarly: Drag a label onto the form, set the Caption properties of each to “Hello, Visual Basic,” and change the font size of the label. (Classic VB used Caption instead of Text for these objects.) The result? Old-fashioned VB app achieved.

To write a code-based version of Hello, Visual Basic, I likewise repeated the same steps. In this simpler and friendlier version of Visual Basic, the Load function is a lot easier to read:
Private Sub Form_Load() End Sub
As for the code that I placed inside that function, it is similarly simple:
Form1.Caption = "Hello, Visual Basic" Label1.Caption = Form1.Caption
Again, it works identically.
As a final step, I used Visual Basic 4 to create an EXE version of the application. This EXE, is essentially a standalone, and freely redistributable application. All that’s required is the Visual Basic runtime. You gotta love Visual Basic.

Next up, we’ll go back in time again and look at Microsoft’s early, pre-Windows BASIC versions.
With technology shaping our everyday lives, how could we not dig deeper?
Thurrott Premium delivers an honest and thorough perspective about the technologies we use and rely on everyday. Discover deeper content as a Premium member.