Waiting for form to exit

  • Thread starter Thread starter Shadowboxer
  • Start date Start date
S

Shadowboxer

I'm having a problem, in vb6 there was a way to stall the application and
wait for user input from a form.
Below I have attached the code of my sub main.

I hope someone has the ability to fix this.

right now the form blinks in and out of existance as fast as the project
compiles, so that won't do.

Module codeStartup



Sub main()

Dim nFrmLogin As frmLogin

nFrmLogin = New frmLogin

nFrmLogin.ShowInTaskbar() = False


nFrmLogin.Show()

'must wait here for user input

Dim fUsername As String, fPassword As String, ftcp As String

fUsername = nFrmLogin.txtUsername.Text

fPassword = nFrmLogin.txtPassword.Text

ftcp = nFrmLogin.txtIP.Text

'

Dim nFrmController As New frmController

nFrmController.Show() 'main application form

'right now the code will exit here.

End Sub

End Module
 
Thanks! That worked
Tom Spink said:
Hi Shadowboxer,


Change that to nFrmLogin.ShowDialog()


Change that to Application.Run(nFrmController)

--
HTH,
-- Tom Spink, Über Geek

Please respond to the newsgroup,
so all can benefit

"Maybe it's a game called 'Punish the User'"
 
Hello,

Shadowboxer said:
I'm having a problem, in vb6 there was a way to stall the
application and wait for user input from a form.
Below I have attached the code of my sub main.

I hope someone has the ability to fix this.

right now the form blinks in and out of existance as fast as the project
compiles, so that won't do.

Module codeStartup



Sub main()

Dim nFrmLogin As frmLogin

nFrmLogin = New frmLogin

nFrmLogin.ShowInTaskbar() = False


nFrmLogin.Show()

'must wait here for user input

Call 'nFrmLogin''s 'ShowDialog' method instead of calling its 'Show' method.
Dim fUsername As String, fPassword As String, ftcp As String

fUsername = nFrmLogin.txtUsername.Text

fPassword = nFrmLogin.txtPassword.Text

ftcp = nFrmLogin.txtIP.Text

'

Dim nFrmController As New frmController

nFrmController.Show() 'main application form

'right now the code will exit here.

Your application needs a message loop:

\\\
Application.Run(nFrmController)
///

Regards,
Herfried K. Wagner
 
Back
Top