253 comments

[ 3.1 ms ] story [ 289 ms ] thread
Very nicely done, now a Delphi and I can finally be happy about the state of development again.

Sourcecode: https://github.com/BAndysc/AvaloniaVisualBasic6

Edit: someone information about Lazarus deleted their comment, my answer;

I know about Lazarus yes; I use it for my old projects. I would like a modern version that also works in-browser and .NET seems good for that as this shows. Maybe based on this https://pascalabc.net/en/ .

Not kidding; I still enjoy Pascal/Lazarus (and common lisp) programming more than anything current; none of the anxiety and all of the joy and productivity.

(comment deleted)
Just because you can use some technology in .net on the client and inside the browser does not mean you should. Most of the time these frameworks have huge tradeoffs and once you are using it, you will quickly be locked in.

I.e it’s way easier to migrate from mvc to mvc than from webforms to blazor/avaloniaui/dotvvm

I can't get it to actually do anything, is it supposed to work to run programs in the browser? (mac, chrome)
turns out I had a typo and it doesn't report errors as far as I can tell
Maybe you need to explicitly capture the errors to view the error number and/or message in a message box or something? I have no idea, just guessing based on some prior VBA work I did.
The real VB6 IDE would report errors like this at compile time.
There's no compilation (yet?) -- the code is interpreted, so runtime only.
Syntax Errors reporting was missing indeed, but I just added it now and it would show a message box (while you write the code)
It does! Drag some controls onto the form and hit the play button.
Event handlers don't seem to run (I couldn't get the simplest MsgBox to work, at least). Is the actual language implemented?
They're working for me

Drag a button, double click, MsgBox "hello" in the event handler, hit play

(comment deleted)
Same issue here, I add UI elements just fine, double click and generate the event handlers, but nothing runs.
Hey, author here, I didn't implement all the properties and events, i.e. the Click event on labels was missing. Updated the website with all the basic events.
It works :-)

Amazing, such a fun project. Very well done.

Hey, author here, only a subset of VB6 language is implemented, I also didn't implement all properties and events, i.e. the Click event on labels. Updated the website with all basic events.

Considering how much response this project got, I might improve the VB6 interpreter :)

Say what you like about Visual Basic (and a lot has been said that is less than complimentary), but for a huge number of people and workplaces this was the tool that moved people from trying to fudge Excel or Access into a workflow and actually trying to write some software.

My first language was BASIC on 8-bit machines (actually, it may have technically been Logo on a BBC, but I remember BASIC on a BBC as an 11 year old more clearly), and by the time VB came along I'd moved onto compiled languages like C and interpreted languages like Perl and PHP, and was a bit sniffy about the point and click nature of it all. I had one friend at college who refused to move on from QBASIC - I once saw him write a 3D game engine in that could about 30 frames _an hour_ on a Pentium - and the general atmosphere of being pro-FLOSS/anti-MS, plus a ton of really badly written apps encountered out in the wild when I did some small business IT consultancy made me very averse to VB in general.

But you know, it wasn't the fault of the environment or the language. It was powerful, useful and better than the alternatives for a lot of people. Its main contemporary competitor - Delphi - seemed all the rage before it didn't. And I now wish we'd been able to get a little more down the simpler visual programming domain for a while, because the modern equivalents like XCode feel massively confusing to the novice, so the learning curve feels very steep by comparison.

(comment deleted)
> a ton of really badly written apps encountered out in the wild when I did some small business IT consultancy made me very averse to VB in general.

A lot of VB has been historically written by people who had no background in writing software. They were jack of all trades, needed some quick and dirty and they learned just enough to have some working code

This might be classic "that's not a bug, it's a feature", territory.

I love the idea that somebody could just get something working - it is fantastic that was possible, and a shame that we've lost it a bit.

The fact that a professional might look at the code produced and die a little inside is where a lot of bad rep comes from, but hey, working software is better than no software, particularly in the days when that software probably is running on a single machine that is not connected to the internet, and when it is, it's only connected a couple of hours a day via dial-up modem.

VB6 is how I got really started off with programming and building games. There were project files you could find online of games made in VB6 of such immense complexity (one was an 'MMORPG' with networking, file save/load and data serialisation via RTF blocks, etc.) that it made my head spin. I don't know if I would have gotten into programming at such a young age otherwise.
Are you by any chance talking about Mirage online (and it’s many other servers)?

I remember loving that game (or the Jerrath Online server anyways) and being amazed by it. I knew enough about computers to know it was programmed in VB 6, but not enough to actually code.

But the desire to eventually make something like it definitely had to do with my interest in coding later on.

(comment deleted)
Whoa. VB6 was totally what got me into software development as a kid. A blast from the past I needed today, thanks.
Same. A pirate copy of VB6 and a download of some website which gave a reasonable introduction of how to do things. I remember doing things like using the Win32 API to get DMA to images so I could do pixel perfect collision detection between sprites etc. Fun times.
> A pirate copy of VB6

exactly how i did it as well! But it was a pirated copy of visual studio (6?) and it came in 6 CDs. I had no idea what it actually was, and just installed it and played around.

I'm so glad that i bought those pirated CDs off the street - it was a huge stack of disks for like $50 bucks, and it included a bunch of pirated games, pirated encyclopedia (brittanica at the time iirc), various music software (cakewalk pro, not that i ever used it).

There would not have been a chance in hell i'd discover these things by myself.

6 CDs because VS6 comes with 3 CDs and 3CDs for MSDN.

But later they switched to new format of MSDN and old IDEs can't use them. And there was some add-on that allow to old IDEs to use new MSDN format.

I have a very similar memory, building a Spacewar-type game and experimenting with low level stuff to try to get things flicker-free
Same. But it didn't take me long, with the exuberance of youth, to declare BASIC a worthless language, and then moved to MS Visual C++ 6.

C++ and MFC was worse for different reasons, but then I discovered Linux and the rest is history.

Still, haven't found anything as powerful as VB6's RAD. These days we lay out UIs by hand or by writing XML, like absolute cavemen.

> Still, haven't found anything as powerful as VB6's RAD

We could easily do this now if companies would accept standard UI component styles instead of everyone inventing their own.

Layout has nothing to do with styling. The placement of a button has nothing to do whether it's a native one or it's green.

Even on the web, the set of controls we use are mostly the same we did in the 90s, except everyone styles them differently.

And everyone reinvents their own way to lay them out, and handle the dynamic consequences. It may or may not be a consequence of the web stack inherently tying together layout and styling; nevertheless the layout part was in the past done easier and better with visual tools.
I used WinForms for many years before going to the web when they slashed old dotnet. Flex and grid are better than the visual designers. Next.js pages router, React, Styled Components and devserver like Vite or Rsbuild is the best dev experience I have yet encountered. Fast Refresh / Hot Module Replacement is an incredible feature.
It is funny I had the same exact journey but starting from VB4. I actually wonder what would have happened if instead of killing VB for .NET that Microsoft instead merged legacy VB into the Office team and actually updated it instead of the perpetual state of deprecation that it has been in.
VB was the absolute sweet spot when you used Visual C++ to create performant DLLs which you could then use in VB.
This reminds me of one of the best programming tools at the time. Moving from basic to vs basic was mind blowing. I still miss such tools in the Modern era. There are lot of so called no-code or low-code tools that does things very differently today. I still think the best low-code is what VB did.
And honestly, with the reactive programming approach ... a related UX for IDE should not be that hard either.

I think most framework developers unfortunately forget productivity as a key metric. Might be a bit unfair however, the lack of visual tools is disappointing.

The issue today is that developers would create their own framework, most likely something TypeScript-based running in Node or Deno or some Rust-based thing like Tauri, which all might be OK, but with their own opinionated UI styleguides and features, where then half of the native OS functionality then won't work.

You see a somewhat related degeneration in Redmond, where the new Windows Explorer doesn't have an icon in the address bar which is actually draggable so that a shortcut to the currently open folder can be created on the desktop or anywhere where such a shortcut can be used (think TrueLaunchBar). Now you have to go to the parent folder in order to Alt-Drag the folder to create a shortcut.

It's those little things which where smartly developed during the 80s and 90s, which "modern" developers seem not to have noticed and therefore just ignored while re-implementing applications like the Windows Explorer.

There are so many Chesterson's Fences[1] being destroyed with modern UX design. Everyone just wants to change things for change's sake. Or worse, to simply have another piece of unique artwork for one's portfolio. Whenever I've tried to push back on Yet Another Big UI Design, the reasons for doing it are always so vague: Our current product looks "dated." It's not "fresh." Competitors' products look "sleeker." We're using "outdated" design language. So we overhaul the application, throwing years of know-how and bugfixes away in all the refactoring.

1: https://en.wikipedia.org/wiki/Wikipedia:Chesterton%27s_fence

Alt-drag from the parent folder... so that's the workaround... thanks for the tip on handling this deprecated feature.

Not only has the folder address icon-drag been lost in the name of progress, so too have dozens of previously useful keyboard shortcuts, plus the core ability to re-dock Windows Start Bar onto any edge of the screen... nowadays in Win11 we are restricted to only docking at the bottom.

> And honestly, with the reactive programming approach ... a related UX for IDE should not be that hard either.

I think that's what Apple is attempting with SwiftUI previews in Xcode; given how long that took to not suck, I'd say it's probably harder than it seems.

> I still miss such tools in the Modern era. There are lot of so called no-code or low-code tools that does things very differently today.

You don't have to miss it, there's still one that does things similarly: https://www.lazarus-ide.org/

I miss VB 6, because it was so easy to teach people how programming works as the visual nature was very intuitive.

I have felt for a long time a modern version would be so useful.

You can do the exact same thing, with a nearly 100% exact user interface in the latest version of Visual Studio 2022 that came out yesterday.

I've been building desktop apps like this for 30 years. I still build them every day and the designer looks no different today.

I did not know that, thank you.

I guess the windows pc I have won’t be exclusively for gaming anymore!

Oh, interesting. I should see if I can get my 22 year old coursework running in it.

Assuming I can get my source out of the Word document, because it predates git and I don't have the original source files: https://github.com/BenWheatley/A2-coursework

It seems like you can write VBA to extract stuff from Microsoft Office files. It might be worth a try. Here is what I found: https://stackoverflow.com/questions/49724/programmatically-e...
The code in this case is plain text within the word doc — the hard part is that I don't have a copy of Word from 2002-ish (I don't know the specific Office version my teachers used), and it's spread over 261 pages because I was having too much fun writing it.

ChatGPT can probably do it, but my experience is that it starts hallucinating well before you'd expect from the context length.

If you can't open it in a modern Office install, Microsoft used to have the option to download input filters for old and unusual formats.
Immediately after seeing the page, got "oh, those were the times" feeling. Really great.
Wow, really nice !!

And very interesting project too...

Thanks !

After going to Help > Avalonia on the Web, the UI stopped responding
Page is not loading in Firefox 132.0.1 on MacOS Intel 15.1?

Edit: no, it just takes a loooooong time to load

(comment deleted)
I see lots of comments about how good VB6 was. I agree it made programming super-easy and practical.

However, it is evident to me how the whole thing fell appart by the late 2000's, and now we have much more powerful, yet complex programming environments:

- Rust, C, C++: Extremely complex but powerful.

- HTML, JS, CSS: You have to learn 3 different technologies and won't be able to leverage the easy, powerful native APIs the OS provides. It's cross-platform though.

- .net: Not as easy as VB6 (and C# becomes actually more and more complex, more powerful as well, though). You have to learn XAML as WinForms is still a thing but considered legacy.

- Python: Easy (maybe more than VB, but not by much?), but no native, easy GUI toolkit for Windows. There are native bindings for GTK, but Linux is not a big desktop platform, and more so in business, and still GTK is much, much more complex than VB6 + Winforms + COM.

So basically, it seems we have traded easy of use and practicality for power/performance and cross-platform compatibility? What do you guys think?

I often muse over there not being a VB-alike approach for Python.

It would surely be reasonably straightforward to automate the creation of the GUI boilerplate code from a form designer, and then within an accompanying IDE hide most of that code from the user, only making the specific parts visible that correlate with different UI interactions?

> creation of the GUI boilerplate code from a form designer

why? i think the approach of of the form designer generating code instead of generating serialized objects that your code interacts with at runtime is a serious flaw. java got it wrong, cocoa got it right there.

I guess because that seems the path of least resistance within the existing Python world.
PyQt/PySide with QT Creator is the closest equivalent.
VB6 made writing Windows GUI applications very easy (on screen form designer), particularly when interfacing with COM libraries written in languages such as C++. No-one would use it if performance was an issue. Better was Borland's Delphi, with much the same features, but that ship sailed long ago.
VB6 is a terrible, quirky programming language, and it’s a pain to debug, especially if you’re used to modern development tools.

Microsoft killed it to push .NET (although originally, VB.NET was promoted as the main GUI language). People went to .NET, but also chose the "adult" language of C# along the way. Also, WinForms isn’t deprecated (it was in maintenance mode for some time, but now it gets some new features).

Language history aside, browser-based UIs are easier to develop and deliver, so they won over desktop applications.

One of the "quirks" that really caught me out once was the fact that VB6 doesn't do short-circuit evaluation of logical operators....
VB.NET was apparently suppose to get short-circuited evaluation, but many of the old VB6 developers hated that or misused it in a bunch of places and their code would break when they attempted to move over to VB.NET. So instead Or and And went back to not being short circuited, and we instead got OrElse and AndAlso, both of which are short circuited.
> browser-based UIs are easier to develop and deliver

Compared to the ease of a VB6 winforms app, they are way harder to develop. It's just the delivery that's a little easier - as well as the portability to non-Windows platforms like phones.

Writing a simple VB6 app is easier than a simple React app, sure. But things get complicated when something needs to happen in the background — you need threading, and all the issues that come with threads in most GUI frameworks.
(comment deleted)
There's a ton of visual programming tools out there, they just don't call it visual programming but low code.
Is this supposed to work? It does not for me. Probabbly my privacy settings are prohibitive for it?

And why is this mania putting everything into the browser that does not belong there? Is the reason putting there is just to have it there? Why not desktop app? Any sensible reason? Is it for pepole not owning a computer and have to fly from borrowed one to borrowed one where only the browser access is stable for them? So many things are particular with browsers for the purpose navigating the web or other source of information that it negatively interferes with usability for generic purpose app if not running the extra miles to get a workaround for it (and most do not care to run the extra miles). Pushing the wrong button in the browser f.s up something and others are cumbersome too, back utton, refresh, context menus, working with files, mixed with anything else in the tabs, even the address bar is in the way, etc. The few sensible web apps were either narrow use trivial ones doing a simple task thing mostly accessing a client service (human client) or put into a thin client (now its a computer) for clarity. Not user friendly at all. But hey, today's computer "engineers" give no fuck for the user but all for the technology, we all must enjoy that! (No)

You completely missed the fact that this is built using Avalonia, which means that you can run this on desktop (win, linux, osx), mobile (android or ios) AND browser (using wasm) with almost the same codebase. check https://github.com/BAndysc/AvaloniaVisualBasic6, and feel free to try the desktop ones.
The second part was an adjacent complain about the generic trend of putting things to the web too much. As it is obvious. It wasn't about this very project (the "putting everything" =/= 'putting Avalonia based Visual Basic 6', obviously, even the 'everything' is a rhetoric expression here used widespread in generic discussions and not a literal 100%, obviously). Please review it carefully this time, thanks.
This is an application built on Avalonia. You can compile it into a desktop application if you want (https://github.com/BAndysc/AvaloniaVisualBasic6), but because of the framework you get the web version for free. Seems rather ridiculous to complain about a web version of a hobby project just... existing.
for the same reason some people have made run doom on evrything with a bit of processing power and a display, for the funsies
"And why is this maniac putting everything into the browser that does not belong there? Is the reason putting there is just to have it there?"

Haha, relax a bit. If it wasn't a browser application i wouldn't have tried it at all (most people here would not have either). I see it more of a toy than a development environment - but the fact that it seems fully functional and in the browser is impressive to me.

Anyways, 99.99% anyone using VB6 today is doing it for nostalgic purposes, not to develop real useful code - and that's probably what the project had in mind. Just a fun project.

If you did want an accurate no-changes recreation of vb6 on the desktop, just download the original vb6.

more people use it for production than you think. I have 20+ ActiveX controls being used in production using IEMode in Edge =D
> mania putting everything into the browser that does not belong there?

This ship has sailed a long, long time ago.

> Probabbly my privacy settings are prohibitive for it?

Yes. It does not load for me on Firefox unless you disable fingerprinting protection.

I guess that disables ALL wasm access to the canvas.
> Why not desktop app? Any sensible reason?

It is a desktop app as well. It's written in C# and Avalonia. You can compile it to Windows, MacOS, Linux, iOS, and Android. You can also compile it to WebAssembly, which is what has been done here for this demo:

https://github.com/BAndysc/AvaloniaVisualBasic6

WebAssembly brings all languages to the web and this is a nice example of the power of wasm.

[flagged]
(comment deleted)
Lol, that's amazing, as soon as it loaded up i was laughing at how accurate it was . So many memories from simpler times coding as a kid.
Visual FoxPro as well, please :)
My college thesis was writing complete inventory management using VB6, then making sure the program works inside the company. Good times!
Perusing the authors Github, it looks like they also maintain the UI library for the classic Win9x look and feel: https://github.com/BAndysc/Classic.Avalonia

I love it, I might have to try making my own app using it

IMO that library is worth a submission as much as the VB6 recreation! The attention to detail is excellent, it makes me want to dive into Avalonia again.
Author of the demo and library here, thank you for kind words, this was my goal to achieve almost pixel perfect recreation of the original GUI (which is sometimes not very easy as some components look slightly different in different programs, I meant small differences in buttons sizes, paddings, etc.).
A piece of feedback: The maximized MDI windows did not keep their border, AFAIK.
VB6 was the best IDE by far for people that get things done right now.

I was installing PC based CCTV systems for a living back in mid 2000s, I had a restaurant customer have their mind blown by pandoras music service while demoing the PC. They asked "can I hear this over the restaurant speakers?". Yeah, I got 3.5mm to RCA to BNC in the car which I can run to your AMP.

Now he was really happy, felt like he got launched into the 21st century.

"Can I pause the music and make an announcement to my customers?". I made him a shortcut on the desktop to sndvol32.exe aka sound mixer so he can talk over the speakers and then resume the music and he was again floored.

"I want my staff to be able to do this but not here in my office but at the front counter".

Easy. "Give me a paper clip and 30 minutes". Went to the car to grab some stranded Cat 5 and an old beige two button IBM mouse. Ran the cables from the office to the reception area, soldered a cat-5 pair to the left mouse clicker, drove a sheetrock screw threw the mouse body to mount it on the wall like a taxidermied deer head. Back in the office I soldered the leads to the paper clip so I could have a solid connection to the LPT port on the PC (I didn't carry DB-25 back then).

It was easy from there: googled "VB6 Volume Mixer". Download that, open the checkbox for mute stereo mix, copy one liner into a timer, set interval for 100ms, check if the pins on the LPT are shorted, if so mute stereo mix, unmute the mic.

This was written in the field without any pre planning. I still have this customer to this day. What a great tool for us "jacks of all trades".

I'm pretty sure I read a reddit comment a few years ago where someone said they were a customer in a resturant, and they saw resturant employees click on a mouse attached to the wall to make an announcements (I think notify that an order was ready). It sounds like a very unique setup, so it was probably this one!
I love VB6 too, but what you've described is only 10% VB6 and 90% MacGyver. The Phoenix Foundation needs you.
> VB6 was the best IDE by far for people that get things done right now.

No, it was second-best. The best was Delphi. (And now possibly Lazarus.)

Oh the memories. How does this work? Is it built using an emulator of old VB6 code ? (didn't realize it was opensource) . Or is everything built from scratch?
Hey, author here, I built everything from scratch. It supports only a subset of VB6 so it wasn't difficult or long. I wrote an interpreter for VB6 code
OMG, this is how I started programming. I was so happy creating small helpers with this toolchain, e.g. something like Spotlight to launch programs with with a hotkey + the name of the program, on Windows 98.
This is amazing. I love the nostalgia, it made my day.
Haha, it hit me with a tinge of pain that I probably saw the screen (the original one) a lot, thinking "Today is the day I learn VB6!", but I never got proficient with VB6.

Oh well, I still managed to have a career in IT, so...