[size=2][color=#0000ff]Option [/color][/size][size=2][color=#0000ff]Strict [/color][/size][size=2][color=#0000ff]Off[/color][/size]
[size=2][color=#0000ff]Option [/color][/size][size=2][color=#0000ff]Explicit [/color][/size][size=2][color=#0000ff]On[/color][/size]
[size=2][color=#0000ff]Imports[/color][/size][size=2] VB = Microsoft.VisualBasic[/size]
[size=2][color=#0000ff]Imports[/color][/size][size=2] Microsoft.Win32
[/size][size=2][color=#0000ff]Friend[/color][/size][size=2][color=#0000ff]Class[/color][/size][size=2] InstallProgress[/size]
[size=2][color=#0000ff]Inherits[/color][/size][size=2] System.Windows.Forms.Form
#[/size][size=2][color=#0000ff]Region[/color][/size][size=2] "Windows Form Designer generated code "[/size]
[size=2][color=#0000ff]Public[/color][/size][size=2][color=#0000ff]Sub[/color][/size][size=2][color=#0000ff]New[/color][/size][size=2]()
[/size][size=2][color=#0000ff]MyBase[/color][/size][size=2].New()
[/size][size=2][color=#0000ff]If[/color][/size][size=2] m_vb6FormDefInstance [/size][size=2][color=#0000ff]Is[/color][/size][size=2][color=#0000ff]Nothing[/color][/size][size=2][color=#0000ff]Then[indent][/color][/size][size=2][color=#0000ff]If[/color][/size][size=2] m_InitializingDefInstance [/size][size=2][color=#0000ff]Then
[/color][/size][size=2]m_vb6FormDefInstance = [/size][size=2][color=#0000ff]Me
[/indent][/color][/size][size=2][color=#0000ff]Else
[/color][/size][size=2][color=#0000ff]Try[/color][/size][size=2]
[/size][size=2][color=#008000]'For the start-up form, the first instance created is the default instance.[indent][/color][/size][size=2][color=#0000ff]If[/color][/size][size=2] System.Reflection.Assembly.GetExecutingAssembly.EntryPoint.DeclaringType [/size][size=2][color=#0000ff]Is[/color][/size][size=2][color=#0000ff]Me[/color][/size][size=2].GetType [/size][size=2][color=#0000ff]Then[/color][/size]
[size=2]m_vb6FormDefInstance = [/size][size=2][color=#0000ff]M[/color][/size]
[size=2][color=#0000ff]End[/color][/size][size=2][color=#0000ff]If
[/indent][/color][/size][size=2][color=#0000ff]Catch
[/color][/size][size=2][color=#0000ff]End[/color][/size][size=2][color=#0000ff]Try
[/color][/size][size=2][color=#0000ff]End[/color][/size][size=2][color=#0000ff]If
[/color][/size][size=2][color=#0000ff]End[/color][/size][size=2][color=#0000ff]If
[/color][/size][size=2][color=#008000]'This call is required by the Windows Form Designer.
[/color][/size][size=2]InitializeComponent()
[/size][size=2][color=#0000ff]End[/color][/size][size=2][color=#0000ff]Sub
[/color][/size][size=2][color=#008000]'Form overrides dispose to clean up the component list.
[/color][/size][size=2][color=#0000ff]Protected[/color][/size][size=2][color=#0000ff]Overloads[/color][/size][size=2][color=#0000ff]Overrides[/color][/size][size=2][color=#0000ff]Sub[/color][/size][size=2] Dispose([/size][size=2][color=#0000ff]ByVal[/color][/size][size=2] Disposing [/size][size=2][color=#0000ff]As[/color][/size][size=2][color=#0000ff]Boolean[/color][/size][size=2])
[/size][size=2][color=#0000ff]If[/color][/size][size=2] Disposing [/size][size=2][color=#0000ff]Then
[/color][/size][size=2][color=#0000ff]If[/color][/size][size=2][color=#0000ff]Not[/color][/size][size=2] components [/size][size=2][color=#0000ff]Is[/color][/size][size=2][color=#0000ff]Nothing[/color][/size][size=2][color=#0000ff]Then
[/color][/size][size=2]components.Dispose()
[/size][size=2][color=#0000ff]End[/color][/size][size=2][color=#0000ff]If
[/color][/size][size=2][color=#0000ff]End[/color][/size][size=2][color=#0000ff]If
[/color][/size][size=2][color=#0000ff]MyBase[/color][/size][size=2].Dispose(Disposing)
[/size][size=2][color=#0000ff]End[/color][/size][size=2][color=#0000ff]Sub[/color][/size]
[size=2][color=#0000ff]'Start of sub[/color][/size]
[size=2][color=#0000ff][size=2][color=#0000ff]Private[/color][/size][size=2][color=#0000ff]Sub[/color][/size][size=2][color=#000000] InstallProgress_Load([/color][/size][size=2][color=#0000ff]ByVal[/color][/size][size=2][color=#000000] eventSender [/color][/size][size=2][color=#0000ff]As[/color][/size][size=2][color=#000000] System.Object, [/color][/size][size=2][color=#0000ff]ByVal[/color][/size][size=2][color=#000000] eventArgs [/color][/size][size=2][color=#0000ff]As[/color][/size][size=2][color=#000000] System.EventArgs) [/color][/size][size=2][color=#0000ff]Handles[/color][/size][size=2][color=#0000ff]MyBase[/color][/size][size=2][color=#000000].Load[/color]
[/size][size=2][color=#008000]
[/color][/size][size=2]InstallProgress.DefInstance.Show()
InstallProgress.DefInstance.Refresh()
[/size][size=2]'some code goes here
PBar.Value = 10
InstallProgress.DefInstance.Refresh()
[size=2]Status.Text = "Copying new program files..."
PBar.Value = 40
InstallProgress.DefInstance.Refresh()
'some code goes here
[size=2]Status.Text = "Importing required windows registry settings..."
PBar.Value = 70
InstallProgress.DefInstance.Refresh()
'some code goes here
'End of sub
[size=2]InstallProgress.DefInstance.Close()
[/size][/size][/size][/size][/color][/size]