<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://www.vbex.ru/index.php?action=history&amp;feed=atom&amp;title=VB.Net_by_API%2FSystem.Windows.Forms%2FApplication</id>
		<title>VB.Net by API/System.Windows.Forms/Application - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://www.vbex.ru/index.php?action=history&amp;feed=atom&amp;title=VB.Net_by_API%2FSystem.Windows.Forms%2FApplication"/>
		<link rel="alternate" type="text/html" href="http://www.vbex.ru/index.php?title=VB.Net_by_API/System.Windows.Forms/Application&amp;action=history"/>
		<updated>2026-04-05T09:01:44Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://www.vbex.ru/index.php?title=VB.Net_by_API/System.Windows.Forms/Application&amp;diff=2758&amp;oldid=prev</id>
		<title> в 16:40, 26 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://www.vbex.ru/index.php?title=VB.Net_by_API/System.Windows.Forms/Application&amp;diff=2758&amp;oldid=prev"/>
				<updated>2010-05-26T16:40:16Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 16:40, 26 мая 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
			</entry>

	<entry>
		<id>http://www.vbex.ru/index.php?title=VB.Net_by_API/System.Windows.Forms/Application&amp;diff=2759&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://www.vbex.ru/index.php?title=VB.Net_by_API/System.Windows.Forms/Application&amp;diff=2759&amp;oldid=prev"/>
				<updated>2010-05-26T12:52:24Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Application.AddMessageFilter==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt;  &lt;br /&gt;
Imports System.Drawing&lt;br /&gt;
Imports System.Drawing.Drawing2D&lt;br /&gt;
Imports System.Windows.Forms&lt;br /&gt;
Imports System.Math&lt;br /&gt;
public class MessageFilter&lt;br /&gt;
   public Shared Sub Main&lt;br /&gt;
         Application.Run(New Form1)&lt;br /&gt;
   End Sub&lt;br /&gt;
End class&lt;br /&gt;
Public Class Form1&lt;br /&gt;
    Public Class NoLeftDownMessageFilter&lt;br /&gt;
        Implements IMessageFilter&lt;br /&gt;
        Public Function PreFilterMessage(ByRef m As System.Windows.Forms.Message) As Boolean Implements IMessageFilter.PreFilterMessage&lt;br /&gt;
            Const WM_LBUTTONDOWN As Long = &amp;amp;H201&lt;br /&gt;
            Return (m.Msg = WM_LBUTTONDOWN)&lt;br /&gt;
        End Function&lt;br /&gt;
    End Class&lt;br /&gt;
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load&lt;br /&gt;
        Dim no_left_down_message_filter As New NoLeftDownMessageFilter&lt;br /&gt;
        Application.AddMessageFilter(no_left_down_message_filter)&lt;br /&gt;
    End Sub&lt;br /&gt;
    Private Sub Form1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Click&lt;br /&gt;
        Application.UseWaitCursor = Not Application.UseWaitCursor&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class&lt;br /&gt;
&amp;lt;Global.Microsoft.VisualBasic.rupilerServices.DesignerGenerated()&amp;gt; _&lt;br /&gt;
Partial Public Class Form1&lt;br /&gt;
    Inherits System.Windows.Forms.Form&lt;br /&gt;
    &amp;quot;Form overrides dispose to clean up the component list.&lt;br /&gt;
    &amp;lt;System.Diagnostics.DebuggerNonUserCode()&amp;gt; _&lt;br /&gt;
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)&lt;br /&gt;
        If disposing AndAlso components IsNot Nothing Then&lt;br /&gt;
            components.Dispose()&lt;br /&gt;
        End If&lt;br /&gt;
        MyBase.Dispose(disposing)&lt;br /&gt;
    End Sub&lt;br /&gt;
    Private components As System.ruponentModel.IContainer&lt;br /&gt;
    &amp;lt;System.Diagnostics.DebuggerStepThrough()&amp;gt; _&lt;br /&gt;
    Private Sub InitializeComponent()&lt;br /&gt;
        Me.SuspendLayout()&lt;br /&gt;
        Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)&lt;br /&gt;
        Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font&lt;br /&gt;
        Me.ClientSize = New System.Drawing.Size(292, 273)&lt;br /&gt;
        Me.Text = &amp;quot;UseMessageFilter&amp;quot;&lt;br /&gt;
        Me.ResumeLayout(False)&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Application.ApplicationExit==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
Imports System.Windows.Forms&lt;br /&gt;
Public Class Form1&lt;br /&gt;
    Inherits System.Windows.Forms.Form&lt;br /&gt;
    Friend WithEvents button4 As System.Windows.Forms.Button&lt;br /&gt;
    Friend WithEvents button3 As System.Windows.Forms.Button&lt;br /&gt;
    Friend WithEvents button2 As System.Windows.Forms.Button&lt;br /&gt;
    Friend WithEvents button1 As System.Windows.Forms.Button&lt;br /&gt;
    Public Sub New()&lt;br /&gt;
        MyBase.New()&lt;br /&gt;
        Me.button4 = New System.Windows.Forms.Button()&lt;br /&gt;
        Me.button3 = New System.Windows.Forms.Button()&lt;br /&gt;
        Me.button2 = New System.Windows.Forms.Button()&lt;br /&gt;
        Me.button1 = New System.Windows.Forms.Button()&lt;br /&gt;
        Me.SuspendLayout()&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.button4.Location = New System.Drawing.Point(24, 127)&lt;br /&gt;
        Me.button4.Name = &amp;quot;button4&amp;quot;&lt;br /&gt;
        Me.button4.Size = New System.Drawing.Size(144, 23)&lt;br /&gt;
        Me.button4.TabIndex = 7&lt;br /&gt;
        Me.button4.Text = &amp;quot;Show MessageBox&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.button3.Location = New System.Drawing.Point(24, 90)&lt;br /&gt;
        Me.button3.Name = &amp;quot;button3&amp;quot;&lt;br /&gt;
        Me.button3.Size = New System.Drawing.Size(144, 23)&lt;br /&gt;
        Me.button3.TabIndex = 6&lt;br /&gt;
        Me.button3.Text = &amp;quot;Throw Exception&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.button2.Location = New System.Drawing.Point(24, 53)&lt;br /&gt;
        Me.button2.Name = &amp;quot;button2&amp;quot;&lt;br /&gt;
        Me.button2.Size = New System.Drawing.Size(144, 23)&lt;br /&gt;
        Me.button2.TabIndex = 5&lt;br /&gt;
        Me.button2.Text = &amp;quot;Application.ExitThread&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.button1.Location = New System.Drawing.Point(24, 16)&lt;br /&gt;
        Me.button1.Name = &amp;quot;button1&amp;quot;&lt;br /&gt;
        Me.button1.Size = New System.Drawing.Size(144, 23)&lt;br /&gt;
        Me.button1.TabIndex = 4&lt;br /&gt;
        Me.button1.Text = &amp;quot;Application.Exit&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)&lt;br /&gt;
        Me.ClientSize = New System.Drawing.Size(192, 166)&lt;br /&gt;
        Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.button4, Me.button3, Me.button2, Me.button1})&lt;br /&gt;
        Me.ResumeLayout(False)&lt;br /&gt;
    End Sub&lt;br /&gt;
    Shared Sub App_Exit(ByVal sender As Object, ByVal e As EventArgs)&lt;br /&gt;
        System.Diagnostics.Debug.WriteLine(&amp;quot;App_Exit&amp;quot;)&lt;br /&gt;
    End Sub&lt;br /&gt;
    Shared Sub App_Idle(ByVal sender As Object, ByVal e As EventArgs)&lt;br /&gt;
        System.Diagnostics.Debug.WriteLine(&amp;quot;App_Idle&amp;quot;)&lt;br /&gt;
    End Sub&lt;br /&gt;
    Shared Sub App_ThreadingException(ByVal sender As Object, ByVal e As System.Threading.ThreadExceptionEventArgs)&lt;br /&gt;
        System.Diagnostics.Debug.WriteLine(&amp;quot;App_ThreadException&amp;quot;)&lt;br /&gt;
        Dim msg As String = &amp;quot;A problem has occurred in this application.&amp;quot; &amp;amp; vbCrLf &amp;amp; vbCrLf &amp;amp; _&lt;br /&gt;
            vbTab &amp;amp; e.Exception.Message &amp;amp; vbCrLf &amp;amp; vbCrLf &amp;amp; _&lt;br /&gt;
            &amp;quot;Would you like to continue the application so that &amp;quot; &amp;amp; vbCrLf &amp;amp; _&lt;br /&gt;
            &amp;quot;you can save your work?&amp;quot;&lt;br /&gt;
        Dim res As DialogResult = MessageBox.Show(msg, &amp;quot;Unexpected Error&amp;quot;, MessageBoxButtons.YesNo)&lt;br /&gt;
        If res = System.Windows.Forms.DialogResult.Yes Then Exit Sub&lt;br /&gt;
        Application.Exit()&lt;br /&gt;
    End Sub&lt;br /&gt;
    Shared Sub DumpThreadID(ByVal name As String)&lt;br /&gt;
        System.Diagnostics.Debug.WriteLine(name &amp;amp; &amp;quot; thread id= &amp;quot; &amp;amp; System.AppDomain.GetCurrentThreadId().ToString())&lt;br /&gt;
    End Sub&lt;br /&gt;
    Shared Sub DummyThreadStart()&lt;br /&gt;
        DumpThreadID(&amp;quot;Dummy Thread&amp;quot;)&lt;br /&gt;
        AddHandler Application.ThreadExit, New EventHandler(AddressOf App_ThreadExit)&lt;br /&gt;
    End Sub&lt;br /&gt;
    Shared Sub Main()&lt;br /&gt;
        AddHandler Application.ThreadException, New System.Threading.ThreadExceptionEventHandler(AddressOf App_ThreadingException)&lt;br /&gt;
        AddHandler Application.Idle, New EventHandler(AddressOf App_Idle)&lt;br /&gt;
        AddHandler Application.ThreadExit, New EventHandler(AddressOf App_ThreadExit)&lt;br /&gt;
        AddHandler Application.ApplicationExit, New EventHandler(AddressOf App_Exit)&lt;br /&gt;
        DumpThreadID(&amp;quot;UI Thread&amp;quot;)&lt;br /&gt;
        Dim dummythread As System.Threading.Thread = New System.Threading.Thread(New System.Threading.ThreadStart(AddressOf DummyThreadStart))&lt;br /&gt;
        dummythread.Start()&lt;br /&gt;
        Application.Run(New Form1())&lt;br /&gt;
    End Sub&lt;br /&gt;
    Shared Sub App_ThreadExit(ByVal sender As Object, ByVal e As EventArgs)&lt;br /&gt;
        System.Diagnostics.Debug.WriteLine(&amp;quot;App_ThreadExit on thread id= &amp;quot; &amp;amp; System.AppDomain.GetCurrentThreadId().ToString())&lt;br /&gt;
    End Sub&lt;br /&gt;
    Private Sub button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button1.Click&lt;br /&gt;
        Application.Exit()&lt;br /&gt;
    End Sub&lt;br /&gt;
    Private Sub button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button2.Click&lt;br /&gt;
        Application.ExitThread()&lt;br /&gt;
    End Sub&lt;br /&gt;
    Private Sub button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button3.Click&lt;br /&gt;
        Throw New System.IO.FileLoadException()&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Application.CompanyName==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt;  &lt;br /&gt;
Imports System.Windows.Forms&lt;br /&gt;
public class Test&lt;br /&gt;
   public Shared Sub Main&lt;br /&gt;
        Console.WriteLine(Application.rupanyName)&lt;br /&gt;
        Console.WriteLine(Application.ProductName)&lt;br /&gt;
        Console.WriteLine(Application.ProductVersion)&lt;br /&gt;
   End Sub&lt;br /&gt;
End class&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Application.DoEvents()==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
Option Strict On&lt;br /&gt;
imports System&lt;br /&gt;
imports System.Drawing&lt;br /&gt;
imports System.Windows.Forms&lt;br /&gt;
public class ProgressBars : inherits Form&lt;br /&gt;
  dim pb as ProgressBar&lt;br /&gt;
  dim lbl as Label&lt;br /&gt;
  public sub New()&lt;br /&gt;
    Size = new Size(300,200)&lt;br /&gt;
    dim btn as new Button()&lt;br /&gt;
    btn.Parent = me&lt;br /&gt;
    btn.Text = &amp;quot;&amp;amp;Start&amp;quot;&lt;br /&gt;
    btn.Location = new Point(0,0)&lt;br /&gt;
    AddHandler btn.Click, AddressOf btn_OnClick&lt;br /&gt;
    lbl = new Label()&lt;br /&gt;
    lbl.Parent = me&lt;br /&gt;
    lbl.Size = new Size(100,23)&lt;br /&gt;
    lbl.Location = new Point(0,25)&lt;br /&gt;
    lbl.BorderStyle = BorderStyle.FixedSingle&lt;br /&gt;
    lbl.TextAlign = ContentAlignment.MiddleCenter&lt;br /&gt;
    lbl.Text = &amp;quot;&amp;quot;&lt;br /&gt;
    pb = new ProgressBar()&lt;br /&gt;
    pb.Parent = me&lt;br /&gt;
    pb.Location = new Point(0, 70)&lt;br /&gt;
    pb.Size = new Size(400, 20) &lt;br /&gt;
    pb.Minimum = 0      &amp;quot;  the default value&lt;br /&gt;
    pb.Maximum = 100    &amp;quot;  the default value&lt;br /&gt;
  end sub  &amp;quot;  close for constructor&lt;br /&gt;
  private sub btn_OnClick(ByVal sender as object,ByVal e as EventArgs)&lt;br /&gt;
    dim cntr as integer = 0&lt;br /&gt;
    pb.Value = 0&lt;br /&gt;
    pb.Step = 1&lt;br /&gt;
    for i as integer = 0 to 100000&lt;br /&gt;
      cntr  = cntr + 1&lt;br /&gt;
      if cntr mod 100 = 0 then&lt;br /&gt;
        lbl.Text = cntr.ToString()&lt;br /&gt;
        pb.PerformStep()&lt;br /&gt;
        Application.DoEvents()&lt;br /&gt;
        System.Threading.Thread.Sleep(40)&lt;br /&gt;
      end if&lt;br /&gt;
    next&lt;br /&gt;
  end sub&lt;br /&gt;
  public shared sub Main() &lt;br /&gt;
    Application.Run(new ProgressBars())&lt;br /&gt;
  end sub&lt;br /&gt;
end class&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Application.ExecutablePath==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt;  &lt;br /&gt;
Imports System.Windows.Forms&lt;br /&gt;
Public Class Tester&lt;br /&gt;
    Public Shared Sub Main&lt;br /&gt;
    &lt;br /&gt;
        Console.WriteLine(Application.ExecutablePath)&lt;br /&gt;
        Console.WriteLine(Application.StartupPath)&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Application.Idle==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
Imports System.Windows.Forms&lt;br /&gt;
Public Class Form1&lt;br /&gt;
    Inherits System.Windows.Forms.Form&lt;br /&gt;
    Friend WithEvents button4 As System.Windows.Forms.Button&lt;br /&gt;
    Friend WithEvents button3 As System.Windows.Forms.Button&lt;br /&gt;
    Friend WithEvents button2 As System.Windows.Forms.Button&lt;br /&gt;
    Friend WithEvents button1 As System.Windows.Forms.Button&lt;br /&gt;
    Public Sub New()&lt;br /&gt;
        MyBase.New()&lt;br /&gt;
        Me.button4 = New System.Windows.Forms.Button()&lt;br /&gt;
        Me.button3 = New System.Windows.Forms.Button()&lt;br /&gt;
        Me.button2 = New System.Windows.Forms.Button()&lt;br /&gt;
        Me.button1 = New System.Windows.Forms.Button()&lt;br /&gt;
        Me.SuspendLayout()&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.button4.Location = New System.Drawing.Point(24, 127)&lt;br /&gt;
        Me.button4.Name = &amp;quot;button4&amp;quot;&lt;br /&gt;
        Me.button4.Size = New System.Drawing.Size(144, 23)&lt;br /&gt;
        Me.button4.TabIndex = 7&lt;br /&gt;
        Me.button4.Text = &amp;quot;Show MessageBox&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.button3.Location = New System.Drawing.Point(24, 90)&lt;br /&gt;
        Me.button3.Name = &amp;quot;button3&amp;quot;&lt;br /&gt;
        Me.button3.Size = New System.Drawing.Size(144, 23)&lt;br /&gt;
        Me.button3.TabIndex = 6&lt;br /&gt;
        Me.button3.Text = &amp;quot;Throw Exception&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.button2.Location = New System.Drawing.Point(24, 53)&lt;br /&gt;
        Me.button2.Name = &amp;quot;button2&amp;quot;&lt;br /&gt;
        Me.button2.Size = New System.Drawing.Size(144, 23)&lt;br /&gt;
        Me.button2.TabIndex = 5&lt;br /&gt;
        Me.button2.Text = &amp;quot;Application.ExitThread&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.button1.Location = New System.Drawing.Point(24, 16)&lt;br /&gt;
        Me.button1.Name = &amp;quot;button1&amp;quot;&lt;br /&gt;
        Me.button1.Size = New System.Drawing.Size(144, 23)&lt;br /&gt;
        Me.button1.TabIndex = 4&lt;br /&gt;
        Me.button1.Text = &amp;quot;Application.Exit&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)&lt;br /&gt;
        Me.ClientSize = New System.Drawing.Size(192, 166)&lt;br /&gt;
        Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.button4, Me.button3, Me.button2, Me.button1})&lt;br /&gt;
        Me.ResumeLayout(False)&lt;br /&gt;
    End Sub&lt;br /&gt;
    Shared Sub App_Exit(ByVal sender As Object, ByVal e As EventArgs)&lt;br /&gt;
        System.Diagnostics.Debug.WriteLine(&amp;quot;App_Exit&amp;quot;)&lt;br /&gt;
    End Sub&lt;br /&gt;
    Shared Sub App_Idle(ByVal sender As Object, ByVal e As EventArgs)&lt;br /&gt;
        System.Diagnostics.Debug.WriteLine(&amp;quot;App_Idle&amp;quot;)&lt;br /&gt;
    End Sub&lt;br /&gt;
    Shared Sub App_ThreadingException(ByVal sender As Object, ByVal e As System.Threading.ThreadExceptionEventArgs)&lt;br /&gt;
        System.Diagnostics.Debug.WriteLine(&amp;quot;App_ThreadException&amp;quot;)&lt;br /&gt;
        Dim msg As String = &amp;quot;A problem has occurred in this application.&amp;quot; &amp;amp; vbCrLf &amp;amp; vbCrLf &amp;amp; _&lt;br /&gt;
            vbTab &amp;amp; e.Exception.Message &amp;amp; vbCrLf &amp;amp; vbCrLf &amp;amp; _&lt;br /&gt;
            &amp;quot;Would you like to continue the application so that &amp;quot; &amp;amp; vbCrLf &amp;amp; _&lt;br /&gt;
            &amp;quot;you can save your work?&amp;quot;&lt;br /&gt;
        Dim res As DialogResult = MessageBox.Show(msg, &amp;quot;Unexpected Error&amp;quot;, MessageBoxButtons.YesNo)&lt;br /&gt;
        If res = System.Windows.Forms.DialogResult.Yes Then Exit Sub&lt;br /&gt;
        Application.Exit()&lt;br /&gt;
    End Sub&lt;br /&gt;
    Shared Sub DumpThreadID(ByVal name As String)&lt;br /&gt;
        System.Diagnostics.Debug.WriteLine(name &amp;amp; &amp;quot; thread id= &amp;quot; &amp;amp; System.AppDomain.GetCurrentThreadId().ToString())&lt;br /&gt;
    End Sub&lt;br /&gt;
    Shared Sub DummyThreadStart()&lt;br /&gt;
        DumpThreadID(&amp;quot;Dummy Thread&amp;quot;)&lt;br /&gt;
        AddHandler Application.ThreadExit, New EventHandler(AddressOf App_ThreadExit)&lt;br /&gt;
    End Sub&lt;br /&gt;
    Shared Sub Main()&lt;br /&gt;
        AddHandler Application.ThreadException, New System.Threading.ThreadExceptionEventHandler(AddressOf App_ThreadingException)&lt;br /&gt;
        AddHandler Application.Idle, New EventHandler(AddressOf App_Idle)&lt;br /&gt;
        AddHandler Application.ThreadExit, New EventHandler(AddressOf App_ThreadExit)&lt;br /&gt;
        AddHandler Application.ApplicationExit, New EventHandler(AddressOf App_Exit)&lt;br /&gt;
        DumpThreadID(&amp;quot;UI Thread&amp;quot;)&lt;br /&gt;
        Dim dummythread As System.Threading.Thread = New System.Threading.Thread(New System.Threading.ThreadStart(AddressOf DummyThreadStart))&lt;br /&gt;
        dummythread.Start()&lt;br /&gt;
        Application.Run(New Form1())&lt;br /&gt;
    End Sub&lt;br /&gt;
    Shared Sub App_ThreadExit(ByVal sender As Object, ByVal e As EventArgs)&lt;br /&gt;
        System.Diagnostics.Debug.WriteLine(&amp;quot;App_ThreadExit on thread id= &amp;quot; &amp;amp; System.AppDomain.GetCurrentThreadId().ToString())&lt;br /&gt;
    End Sub&lt;br /&gt;
    Private Sub button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button1.Click&lt;br /&gt;
        Application.Exit()&lt;br /&gt;
    End Sub&lt;br /&gt;
    Private Sub button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button2.Click&lt;br /&gt;
        Application.ExitThread()&lt;br /&gt;
    End Sub&lt;br /&gt;
    Private Sub button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button3.Click&lt;br /&gt;
        Throw New System.IO.FileLoadException()&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Application.ProductName==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt;  &lt;br /&gt;
Imports System.Windows.Forms&lt;br /&gt;
public class Test&lt;br /&gt;
   public Shared Sub Main&lt;br /&gt;
        Console.WriteLine(Application.rupanyName)&lt;br /&gt;
        Console.WriteLine(Application.ProductName)&lt;br /&gt;
        Console.WriteLine(Application.ProductVersion)&lt;br /&gt;
   End Sub&lt;br /&gt;
End class&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Application.ProductVersion==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt;  &lt;br /&gt;
Imports System.Windows.Forms&lt;br /&gt;
public class Test&lt;br /&gt;
   public Shared Sub Main&lt;br /&gt;
        Console.WriteLine(Application.rupanyName)&lt;br /&gt;
        Console.WriteLine(Application.ProductName)&lt;br /&gt;
        Console.WriteLine(Application.ProductVersion)&lt;br /&gt;
   End Sub&lt;br /&gt;
End class&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Application.Run==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
Imports System.Drawing.Drawing2D&lt;br /&gt;
Imports System&lt;br /&gt;
Imports System.Drawing.Text&lt;br /&gt;
Imports System.Drawing&lt;br /&gt;
Imports System.Windows.Forms&lt;br /&gt;
Imports System.Math&lt;br /&gt;
Public Class MainClass&lt;br /&gt;
   Shared Sub Main()&lt;br /&gt;
       Dim form1 As Form = New Form1()&lt;br /&gt;
       Application.Run(form1)&lt;br /&gt;
   End Sub &lt;br /&gt;
End Class&lt;br /&gt;
 &lt;br /&gt;
Public Class Form1&lt;br /&gt;
    Inherits System.Windows.Forms.Form&lt;br /&gt;
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load&lt;br /&gt;
        Me.ResizeRedraw = True&lt;br /&gt;
    End Sub&lt;br /&gt;
    Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint&lt;br /&gt;
        Dim txt As String&lt;br /&gt;
        Dim the_font As New Font(&amp;quot;Times New Roman&amp;quot;, 30, FontStyle.Bold, GraphicsUnit.Pixel)&lt;br /&gt;
        Dim layout_rect As RectangleF&lt;br /&gt;
        e.Graphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAliasGridFit&lt;br /&gt;
        layout_rect = New RectangleF(100, 0, 180, 70)&lt;br /&gt;
        txt = &amp;quot;Today is Monday. Tomorrow is Friday&amp;quot;&lt;br /&gt;
        Dim string_format As New StringFormat&lt;br /&gt;
        string_format.Trimming = StringTrimming.EllipsisWord&lt;br /&gt;
        e.Graphics.DrawString(txt, the_font, Brushes.Black, layout_rect, string_format)&lt;br /&gt;
        e.Graphics.DrawRectangle(Pens.Black, Rectangle.Round(layout_rect))&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Application.StartupPath==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt;  &lt;br /&gt;
Imports System.Windows.Forms&lt;br /&gt;
Public Class Tester&lt;br /&gt;
    Public Shared Sub Main&lt;br /&gt;
    &lt;br /&gt;
        Console.WriteLine(Application.ExecutablePath)&lt;br /&gt;
        Console.WriteLine(Application.StartupPath)&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Application.ThreadException==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
Imports System.Windows.Forms&lt;br /&gt;
Public Class Form1&lt;br /&gt;
    Inherits System.Windows.Forms.Form&lt;br /&gt;
    Friend WithEvents button4 As System.Windows.Forms.Button&lt;br /&gt;
    Friend WithEvents button3 As System.Windows.Forms.Button&lt;br /&gt;
    Friend WithEvents button2 As System.Windows.Forms.Button&lt;br /&gt;
    Friend WithEvents button1 As System.Windows.Forms.Button&lt;br /&gt;
    Public Sub New()&lt;br /&gt;
        MyBase.New()&lt;br /&gt;
        Me.button4 = New System.Windows.Forms.Button()&lt;br /&gt;
        Me.button3 = New System.Windows.Forms.Button()&lt;br /&gt;
        Me.button2 = New System.Windows.Forms.Button()&lt;br /&gt;
        Me.button1 = New System.Windows.Forms.Button()&lt;br /&gt;
        Me.SuspendLayout()&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.button4.Location = New System.Drawing.Point(24, 127)&lt;br /&gt;
        Me.button4.Name = &amp;quot;button4&amp;quot;&lt;br /&gt;
        Me.button4.Size = New System.Drawing.Size(144, 23)&lt;br /&gt;
        Me.button4.TabIndex = 7&lt;br /&gt;
        Me.button4.Text = &amp;quot;Show MessageBox&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.button3.Location = New System.Drawing.Point(24, 90)&lt;br /&gt;
        Me.button3.Name = &amp;quot;button3&amp;quot;&lt;br /&gt;
        Me.button3.Size = New System.Drawing.Size(144, 23)&lt;br /&gt;
        Me.button3.TabIndex = 6&lt;br /&gt;
        Me.button3.Text = &amp;quot;Throw Exception&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.button2.Location = New System.Drawing.Point(24, 53)&lt;br /&gt;
        Me.button2.Name = &amp;quot;button2&amp;quot;&lt;br /&gt;
        Me.button2.Size = New System.Drawing.Size(144, 23)&lt;br /&gt;
        Me.button2.TabIndex = 5&lt;br /&gt;
        Me.button2.Text = &amp;quot;Application.ExitThread&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.button1.Location = New System.Drawing.Point(24, 16)&lt;br /&gt;
        Me.button1.Name = &amp;quot;button1&amp;quot;&lt;br /&gt;
        Me.button1.Size = New System.Drawing.Size(144, 23)&lt;br /&gt;
        Me.button1.TabIndex = 4&lt;br /&gt;
        Me.button1.Text = &amp;quot;Application.Exit&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)&lt;br /&gt;
        Me.ClientSize = New System.Drawing.Size(192, 166)&lt;br /&gt;
        Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.button4, Me.button3, Me.button2, Me.button1})&lt;br /&gt;
        Me.ResumeLayout(False)&lt;br /&gt;
    End Sub&lt;br /&gt;
    Shared Sub App_Exit(ByVal sender As Object, ByVal e As EventArgs)&lt;br /&gt;
        System.Diagnostics.Debug.WriteLine(&amp;quot;App_Exit&amp;quot;)&lt;br /&gt;
    End Sub&lt;br /&gt;
    Shared Sub App_Idle(ByVal sender As Object, ByVal e As EventArgs)&lt;br /&gt;
        System.Diagnostics.Debug.WriteLine(&amp;quot;App_Idle&amp;quot;)&lt;br /&gt;
    End Sub&lt;br /&gt;
    Shared Sub App_ThreadingException(ByVal sender As Object, ByVal e As System.Threading.ThreadExceptionEventArgs)&lt;br /&gt;
        System.Diagnostics.Debug.WriteLine(&amp;quot;App_ThreadException&amp;quot;)&lt;br /&gt;
        Dim msg As String = &amp;quot;A problem has occurred in this application.&amp;quot; &amp;amp; vbCrLf &amp;amp; vbCrLf &amp;amp; _&lt;br /&gt;
            vbTab &amp;amp; e.Exception.Message &amp;amp; vbCrLf &amp;amp; vbCrLf &amp;amp; _&lt;br /&gt;
            &amp;quot;Would you like to continue the application so that &amp;quot; &amp;amp; vbCrLf &amp;amp; _&lt;br /&gt;
            &amp;quot;you can save your work?&amp;quot;&lt;br /&gt;
        Dim res As DialogResult = MessageBox.Show(msg, &amp;quot;Unexpected Error&amp;quot;, MessageBoxButtons.YesNo)&lt;br /&gt;
        If res = System.Windows.Forms.DialogResult.Yes Then Exit Sub&lt;br /&gt;
        Application.Exit()&lt;br /&gt;
    End Sub&lt;br /&gt;
    Shared Sub DumpThreadID(ByVal name As String)&lt;br /&gt;
        System.Diagnostics.Debug.WriteLine(name &amp;amp; &amp;quot; thread id= &amp;quot; &amp;amp; System.AppDomain.GetCurrentThreadId().ToString())&lt;br /&gt;
    End Sub&lt;br /&gt;
    Shared Sub DummyThreadStart()&lt;br /&gt;
        DumpThreadID(&amp;quot;Dummy Thread&amp;quot;)&lt;br /&gt;
        AddHandler Application.ThreadExit, New EventHandler(AddressOf App_ThreadExit)&lt;br /&gt;
    End Sub&lt;br /&gt;
    Shared Sub Main()&lt;br /&gt;
        AddHandler Application.ThreadException, New System.Threading.ThreadExceptionEventHandler(AddressOf App_ThreadingException)&lt;br /&gt;
        AddHandler Application.Idle, New EventHandler(AddressOf App_Idle)&lt;br /&gt;
        AddHandler Application.ThreadExit, New EventHandler(AddressOf App_ThreadExit)&lt;br /&gt;
        AddHandler Application.ApplicationExit, New EventHandler(AddressOf App_Exit)&lt;br /&gt;
        DumpThreadID(&amp;quot;UI Thread&amp;quot;)&lt;br /&gt;
        Dim dummythread As System.Threading.Thread = New System.Threading.Thread(New System.Threading.ThreadStart(AddressOf DummyThreadStart))&lt;br /&gt;
        dummythread.Start()&lt;br /&gt;
        Application.Run(New Form1())&lt;br /&gt;
    End Sub&lt;br /&gt;
    Shared Sub App_ThreadExit(ByVal sender As Object, ByVal e As EventArgs)&lt;br /&gt;
        System.Diagnostics.Debug.WriteLine(&amp;quot;App_ThreadExit on thread id= &amp;quot; &amp;amp; System.AppDomain.GetCurrentThreadId().ToString())&lt;br /&gt;
    End Sub&lt;br /&gt;
    Private Sub button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button1.Click&lt;br /&gt;
        Application.Exit()&lt;br /&gt;
    End Sub&lt;br /&gt;
    Private Sub button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button2.Click&lt;br /&gt;
        Application.ExitThread()&lt;br /&gt;
    End Sub&lt;br /&gt;
    Private Sub button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button3.Click&lt;br /&gt;
        Throw New System.IO.FileLoadException()&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Application.ThreadExit==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
Imports System.Windows.Forms&lt;br /&gt;
Public Class Form1&lt;br /&gt;
    Inherits System.Windows.Forms.Form&lt;br /&gt;
    Friend WithEvents button4 As System.Windows.Forms.Button&lt;br /&gt;
    Friend WithEvents button3 As System.Windows.Forms.Button&lt;br /&gt;
    Friend WithEvents button2 As System.Windows.Forms.Button&lt;br /&gt;
    Friend WithEvents button1 As System.Windows.Forms.Button&lt;br /&gt;
    Public Sub New()&lt;br /&gt;
        MyBase.New()&lt;br /&gt;
        Me.button4 = New System.Windows.Forms.Button()&lt;br /&gt;
        Me.button3 = New System.Windows.Forms.Button()&lt;br /&gt;
        Me.button2 = New System.Windows.Forms.Button()&lt;br /&gt;
        Me.button1 = New System.Windows.Forms.Button()&lt;br /&gt;
        Me.SuspendLayout()&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.button4.Location = New System.Drawing.Point(24, 127)&lt;br /&gt;
        Me.button4.Name = &amp;quot;button4&amp;quot;&lt;br /&gt;
        Me.button4.Size = New System.Drawing.Size(144, 23)&lt;br /&gt;
        Me.button4.TabIndex = 7&lt;br /&gt;
        Me.button4.Text = &amp;quot;Show MessageBox&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.button3.Location = New System.Drawing.Point(24, 90)&lt;br /&gt;
        Me.button3.Name = &amp;quot;button3&amp;quot;&lt;br /&gt;
        Me.button3.Size = New System.Drawing.Size(144, 23)&lt;br /&gt;
        Me.button3.TabIndex = 6&lt;br /&gt;
        Me.button3.Text = &amp;quot;Throw Exception&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.button2.Location = New System.Drawing.Point(24, 53)&lt;br /&gt;
        Me.button2.Name = &amp;quot;button2&amp;quot;&lt;br /&gt;
        Me.button2.Size = New System.Drawing.Size(144, 23)&lt;br /&gt;
        Me.button2.TabIndex = 5&lt;br /&gt;
        Me.button2.Text = &amp;quot;Application.ExitThread&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.button1.Location = New System.Drawing.Point(24, 16)&lt;br /&gt;
        Me.button1.Name = &amp;quot;button1&amp;quot;&lt;br /&gt;
        Me.button1.Size = New System.Drawing.Size(144, 23)&lt;br /&gt;
        Me.button1.TabIndex = 4&lt;br /&gt;
        Me.button1.Text = &amp;quot;Application.Exit&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)&lt;br /&gt;
        Me.ClientSize = New System.Drawing.Size(192, 166)&lt;br /&gt;
        Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.button4, Me.button3, Me.button2, Me.button1})&lt;br /&gt;
        Me.ResumeLayout(False)&lt;br /&gt;
    End Sub&lt;br /&gt;
    Shared Sub App_Exit(ByVal sender As Object, ByVal e As EventArgs)&lt;br /&gt;
        System.Diagnostics.Debug.WriteLine(&amp;quot;App_Exit&amp;quot;)&lt;br /&gt;
    End Sub&lt;br /&gt;
    Shared Sub App_Idle(ByVal sender As Object, ByVal e As EventArgs)&lt;br /&gt;
        System.Diagnostics.Debug.WriteLine(&amp;quot;App_Idle&amp;quot;)&lt;br /&gt;
    End Sub&lt;br /&gt;
    Shared Sub App_ThreadingException(ByVal sender As Object, ByVal e As System.Threading.ThreadExceptionEventArgs)&lt;br /&gt;
        System.Diagnostics.Debug.WriteLine(&amp;quot;App_ThreadException&amp;quot;)&lt;br /&gt;
        Dim msg As String = &amp;quot;A problem has occurred in this application.&amp;quot; &amp;amp; vbCrLf &amp;amp; vbCrLf &amp;amp; _&lt;br /&gt;
            vbTab &amp;amp; e.Exception.Message &amp;amp; vbCrLf &amp;amp; vbCrLf &amp;amp; _&lt;br /&gt;
            &amp;quot;Would you like to continue the application so that &amp;quot; &amp;amp; vbCrLf &amp;amp; _&lt;br /&gt;
            &amp;quot;you can save your work?&amp;quot;&lt;br /&gt;
        Dim res As DialogResult = MessageBox.Show(msg, &amp;quot;Unexpected Error&amp;quot;, MessageBoxButtons.YesNo)&lt;br /&gt;
        If res = System.Windows.Forms.DialogResult.Yes Then Exit Sub&lt;br /&gt;
        Application.Exit()&lt;br /&gt;
    End Sub&lt;br /&gt;
    Shared Sub DumpThreadID(ByVal name As String)&lt;br /&gt;
        System.Diagnostics.Debug.WriteLine(name &amp;amp; &amp;quot; thread id= &amp;quot; &amp;amp; System.AppDomain.GetCurrentThreadId().ToString())&lt;br /&gt;
    End Sub&lt;br /&gt;
    Shared Sub DummyThreadStart()&lt;br /&gt;
        DumpThreadID(&amp;quot;Dummy Thread&amp;quot;)&lt;br /&gt;
        AddHandler Application.ThreadExit, New EventHandler(AddressOf App_ThreadExit)&lt;br /&gt;
    End Sub&lt;br /&gt;
    Shared Sub Main()&lt;br /&gt;
        AddHandler Application.ThreadException, New System.Threading.ThreadExceptionEventHandler(AddressOf App_ThreadingException)&lt;br /&gt;
        AddHandler Application.Idle, New EventHandler(AddressOf App_Idle)&lt;br /&gt;
        AddHandler Application.ThreadExit, New EventHandler(AddressOf App_ThreadExit)&lt;br /&gt;
        AddHandler Application.ApplicationExit, New EventHandler(AddressOf App_Exit)&lt;br /&gt;
        DumpThreadID(&amp;quot;UI Thread&amp;quot;)&lt;br /&gt;
        Dim dummythread As System.Threading.Thread = New System.Threading.Thread(New System.Threading.ThreadStart(AddressOf DummyThreadStart))&lt;br /&gt;
        dummythread.Start()&lt;br /&gt;
        Application.Run(New Form1())&lt;br /&gt;
    End Sub&lt;br /&gt;
    Shared Sub App_ThreadExit(ByVal sender As Object, ByVal e As EventArgs)&lt;br /&gt;
        System.Diagnostics.Debug.WriteLine(&amp;quot;App_ThreadExit on thread id= &amp;quot; &amp;amp; System.AppDomain.GetCurrentThreadId().ToString())&lt;br /&gt;
    End Sub&lt;br /&gt;
    Private Sub button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button1.Click&lt;br /&gt;
        Application.Exit()&lt;br /&gt;
    End Sub&lt;br /&gt;
    Private Sub button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button2.Click&lt;br /&gt;
        Application.ExitThread()&lt;br /&gt;
    End Sub&lt;br /&gt;
    Private Sub button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button3.Click&lt;br /&gt;
        Throw New System.IO.FileLoadException()&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Application.UseWaitCursor==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt;  &lt;br /&gt;
Imports System.Drawing&lt;br /&gt;
Imports System.Drawing.Drawing2D&lt;br /&gt;
Imports System.Windows.Forms&lt;br /&gt;
Imports System.Math&lt;br /&gt;
public class MessageFilter&lt;br /&gt;
   public Shared Sub Main&lt;br /&gt;
         Application.Run(New Form1)&lt;br /&gt;
   End Sub&lt;br /&gt;
End class&lt;br /&gt;
Public Class Form1&lt;br /&gt;
    Public Class NoLeftDownMessageFilter&lt;br /&gt;
        Implements IMessageFilter&lt;br /&gt;
        Public Function PreFilterMessage(ByRef m As System.Windows.Forms.Message) As Boolean Implements IMessageFilter.PreFilterMessage&lt;br /&gt;
            Const WM_LBUTTONDOWN As Long = &amp;amp;H201&lt;br /&gt;
            Return (m.Msg = WM_LBUTTONDOWN)&lt;br /&gt;
        End Function&lt;br /&gt;
    End Class&lt;br /&gt;
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load&lt;br /&gt;
        Dim no_left_down_message_filter As New NoLeftDownMessageFilter&lt;br /&gt;
        Application.AddMessageFilter(no_left_down_message_filter)&lt;br /&gt;
    End Sub&lt;br /&gt;
    Private Sub Form1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Click&lt;br /&gt;
        Application.UseWaitCursor = Not Application.UseWaitCursor&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class&lt;br /&gt;
&amp;lt;Global.Microsoft.VisualBasic.rupilerServices.DesignerGenerated()&amp;gt; _&lt;br /&gt;
Partial Public Class Form1&lt;br /&gt;
    Inherits System.Windows.Forms.Form&lt;br /&gt;
    &amp;quot;Form overrides dispose to clean up the component list.&lt;br /&gt;
    &amp;lt;System.Diagnostics.DebuggerNonUserCode()&amp;gt; _&lt;br /&gt;
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)&lt;br /&gt;
        If disposing AndAlso components IsNot Nothing Then&lt;br /&gt;
            components.Dispose()&lt;br /&gt;
        End If&lt;br /&gt;
        MyBase.Dispose(disposing)&lt;br /&gt;
    End Sub&lt;br /&gt;
    Private components As System.ruponentModel.IContainer&lt;br /&gt;
    &amp;lt;System.Diagnostics.DebuggerStepThrough()&amp;gt; _&lt;br /&gt;
    Private Sub InitializeComponent()&lt;br /&gt;
        Me.SuspendLayout()&lt;br /&gt;
        Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)&lt;br /&gt;
        Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font&lt;br /&gt;
        Me.ClientSize = New System.Drawing.Size(292, 273)&lt;br /&gt;
        Me.Text = &amp;quot;UseMessageFilter&amp;quot;&lt;br /&gt;
        Me.ResumeLayout(False)&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>