If I try a simple example it seems to work OK. However, my application is
too complex to post here. I did find out that if I delete a line of Code I
had, "Application.EnableVisualStyles()" in my sub main, my application works
ok but with this line of code in sub main, it throws an exception when Form2
closes. It does seem to work OK with a simple example however. Maybe it's
one of the controls that I have on my Form1 such as splitter bar, panel,
toolbar, listbox, treeview, etc. Anyway, I'll live with out VisualStyles for
now until I get time to see exactly what's casuing the error.
Sub Main
Application.EnableVisualStyles
Form1.Show
Application.Run()
end Sub
"Herfried K. Wagner [MVP]" wrote:
Dennis,
"Dennis" <De****@discussions.microsoft.com> schrieb: Why does the following slightly modified code cause an exception to be
thrown
on the Application.Run Line?
Public Module Program
Public Sub Main()
Dim f As New Form1()
f.Show()
Application.Run()
End Sub
End Module
In Form1 button 'Click' event handler:
Dim f2 As New Form2()
f2.ShowDialog() Note after return from this Dialog, an exception is
thrown.
I am not able to reproduce that on my machine (.NET 1.1 SP1, Windows XP
Professional SP2). What exception is thrown? Can you post the complete
error message?
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>