r/visualbasic • u/mdausmann • Jun 20 '26
VB6 Help Port VB6 Desktop app to... What?
Ok, say I had a typical desktop app written in VB6 and somebody asked me to 'modernise' it.
And say, for whatever reason, they didn't want a web app based conversion.. i.e. they still wanted a desktop app.
What is your go-to stack for this type of conversion?
WinForms (.NET) - So stay in the Windows/MS ecosystem, maybe port to VB.net first? then across to C#? . This feels pretty safe but I think this would still be Windows only.
WPF (.NET) - Still sticking with MS. More modern but maybe a longer conversion path.
WinUI - I think this is the latest MS option... Is a little bit new (2021)
Flutter Desktop - Clear benefit is cross/platform out of the box and easy port to mobile app. Flutter approach is pretty far from the VB6 approach so it would be a long conversion path I think. The other downside is Flutter on desktop is even newer than WinUI (2022).
Electron - Again, cross platform but with memory issues I think. Web tech heavy so I think this means it would make it easy to port to Web if that was an option later.
Other options? Maui? Delphi?
View all comments
Show parent comment
1
u/tomysshadow Jun 21 '26 edited Jun 22 '26
Yes and no. If it was just being used to display a standard HTML page and that's it, then sure, you could replace it with WebView2 and be done with it. The problem isn't that it's a web browser, it's that the WebBrowser Control embeds Internet Explorer specifically, and provides deep access to its APIs if you wanted to be able to use them.
So in addition to basic stuff like navigation, printing the page that's in the frame, etc. which wouldn't be too hard, you can also cast the control to a ShDocVw and do stuff like:
Meanwhile, the page inside the frame might expect to be able to do stuff like:
<script language="VBScript">)I'm sure I could go on with more stuff, this is just some of the weird things I can think of off the top of my head. Point is that the WebBrowser Control is a door into the broader Internet Explorer ecosystem. A surprising amount of it still works on Windows 11, but it's usually not trivial to replace with something modern or crossplatform.
The great thing about IE was that it was very much designed with being used inside of other applications in mind. It catered to that specific use with APIs that allowed host applications to know a great deal about the current state of the webpage inside the frame. Modern browsers, if they can be embedded at all, it's largely an afterthought. So there are things that the WebBrowser Control can do that other browsers simply cannot do, unless you want to go digging into their source to add the specific feature needed.
This is why the cross platform version of WinForms only promises partial support for the control. It can replace the browser it uses with Firefox or Chrome automatically, but much of the API simply won't work