Modernizing Visual Basic winforms

Posted on 2014-08-17
Last Modified: 2014-08-18

I have become involved with a extremely large software team that has a lot.  (Millions of lines of code). It is migrating from vb6 to most recent frameworks.  The system has many external devices, some which may not have drivers outside of activeX.  

When i google " modernize" vb6 I am lucky to get sites that are 3 years old.    I did a lot of vb 6 in my days then then c#.   It is mandatory we continue to do we have a large shop. No IIS web based solutions will work too many HIPAA issues.

Please if I could get any site references or advice on the most modern way to do and  any advice on handling old vb6 I would appreciate.
Question by:charlesbaldo
    LVL 40

    Accepted Solution

    Unfortunately, if you want code that is efficient, bug free and easy to maintain (if not simply saying maintainable), the only good solution, specially on large projects, is to rewrite everything in .NET.

    The conversion tool generates code that tries to emulate as exactly as possible what the application did in VB6. .NET applications doe not behave the same way. Many things cannot convert (Data controls for instance), and you still have a lot of work to do after the conversion, a good part of it involving debugging of the generated .NET code. It's messy .NET code of a kind that no programmer would ever write. For instance, it will still use the old On Error GoTo, so you have to give up all the information that you can get from an Exception object if error handling is done with Try...Catch.

    Maintainability becomes an issue because the code is hard to understand in places, and you need somebody who knows both VB6 and VB.NET to be able to grasp what is happening. VB6 programmers are getting scarce, and any good programmer who switched to VB.NET will not accept a job where he still have to work often with anything that have to do with VB6.

    The only upgrades I have seen that worked (and in my job as a trainer I have seen a lot of conversions) where in VB6 applications that where doing most of their word in libraries (.dll), leaving only the interface in the executables. In such situations, it was quite easy to rewrite the interfaces in .NET and still use the old dlls, rewriting these only as needed. .NET works quite well with VB6 dlls if these do not use the Variant data type that has no equivalent in .NET.

    As for modernizing, as far as design is concerned, while they were of limited use in VB6, classes become a must in .NET.

    For the interface, it depends what you are aiming for. If you really want to go the Microsoft way, you tone down everything as they do in the new Windows RT (Windows 8) interface: remove the menus, monochrome icons, no gradients, one window at a time, touch enabled, and the likes, even in Windows applications.

    If you are like me and most people I met, however, you want programs that are tools, not programs that are gadgets. You then need to retain a lot of the basic old appearance. Simply by using the controls provided by .NET, you will have a bit of "modernizing". You can enhance that maybe with something else than grey as a background, ribbons instead of menus (although some users prefer menus) and the likes.

    Give a look at the commercial software your users are working with, and ask them what they like most and why. This will guide you in your decisions.
    LVL 77

    Assisted Solution

    by:David Johnson, CD, MVP
    skip winforms and go directly to WPF
    LVL 74

    Assisted Solution

    by:käµfm³d 👽
    skip winforms and go directly to WPF
    Hmmmm...  I was going to suggest that myself. However, you should be aware that there is a bit of a learning curve for WPF. You do get a bit better of a user experience, though. Be sure to do your research on WinForms vs WPF before you make a decision  = )

    Author Comment

    Thank you all.   You more or less let me know what I already thought,  We have a ton of vb6 programmers and a few  I like the WPF path and have already brought it up.

    Rewrite is the path but with millions of lines of code that is FDA and HIPAA requirements it will be slow.

    Thank you all will divide points up

    Author Closing Comment

    Thanks All, no easy solution here that's for sure

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
    I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
    As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
    Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now