Starting a second message loop on a single thread is not a valid operation. Use Form.ShowDialog

i got this message:

"Starting a second message loop on a single thread is not a valid operation. Use Form.ShowDialog instead."

what's the problem?

[152 byte] By [M-Mahrous] at [2007-12-16]
# 1
Sounds like you are calling Application.Run more than once on the same thread. This isn't valid to do. Can you describe more details?

-mark
Program Manager
Microsoft
This post is provided "as-is"

MarkRideout at 2007-9-9 > top of Msdn Tech,Windows Forms,Windows Forms General...
# 2
i used 2 forms to check the settings

the first to ckeck the connection string if it was saved i run the second to check the Choosen Language, and it is another user saved setting

the first code:

Dim con As SqlConnection = New SqlConnection(My.Settings.ConnString)

Try

con.Open()

If con.State = Data.ConnectionState.Open Then

con.Close()

Application.Run(New StartUp())

Me.Close()

End If

Catch ex As Exception

End Try

the second code:

If My.Settings.SaveLang = true Then

If My.Settings.Lang = "Ar" Then

Application.Run(New arMain)

Me.Close()

ElseIf My.Settings.Lang = "En" Then

Application.Run(New EnMain)

Me.Close()

End If

End If


M-Mahrous at 2007-9-9 > top of Msdn Tech,Windows Forms,Windows Forms General...