VB Migration Partner

KNOWLEDGE BASE - Forms and controls

Previous | Index | Next 

[PRB] The VB.NET application ends with a fatal exception when the splash screen closes

As documented in the following KB article: [PRB] The VB.NET application hangs on the splash screen or terminates earlier than expected, you can use the following pragma to activate the VB.NET application framework and select a splash screen form for the application being converted:

        '## EnablesAppFramework frmMain, frmSplash

You should be aware, however, that VB.NET has a known bug that causes random crashes of applications that use the application framework to define splash screens. According to this Microsoft KB article you can work around the issue by adding the following code in the Form_Load event of the splash screen form:

        Private Sub Form_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load
            Dim dummyForm As New Form
            dummyForm.Opacity = 0
            dummyForm.ShowInTaskbar = False
            dummyForm.FormBorderStyle = FormBorderStyle.None
            ' next statement has no effect, because the form is actually invisible
            ' more code in the splash screen form
            ' ...
        End Sub

It should be clear that this bug has nothing to do with VB Migration Partner. However, if you notice that a converted VB.NET application shows an unexpected exception when its splash screen form closes, you can try working around the issue by using a helper method named SplashScreenBugFix6, which creates the invisible “dummy” form:

        Private Sub Form_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load
            ' more code in the splash screen form
            ' ...
        End Sub

Even better, you can use an InsertStatement pragma to generate the method call each time the VB6 project is converted:

        ' in the original VB6 splash screen form
        Private Sub Form_Load()
            '## InsertStatement SplashScreenBugFix6()
            ' ...
        End Sub
Previous | Index | Next 

Follow Francesco Balena on VB6 migration’s group on


Read Microsoft Corp’s official case study of a VB6 conversion using VB Migration Partner.

Code Architects and its partners offers remote and onsite migration services.

More details

Subscribe to our free newsletter for useful VB6 migration tips and techniques.


To learn more about your VB6 applications, run VB6 Analyzer on your source code and send us the generated text file. You will receive a detailed report about your VB6 applications and how VB Migration Partner can help you to quickly and effectively migrate it to .NET.

Get free advice

A fully-working, time-limited Trial Edition of VB Migration Partner allows you to test it against your actual code

Get the Trial

The price of VB Migration Partner depends on the size of the VB6 application, the type of license, and other factors

Request a quote

Migrating a VB6 application in 10 easy steps

Comparing VB Migration Partner with Upgrade Wizard

Migration tools: Feature Comparison Table

All whitepapers