.net 2005 cannot show menu !

  • Thread starter Thread starter Agnes
  • Start date Start date
A

Agnes

I got a login form . When user input the correct password, the Main menu
will be shown.Everything works under .net 2003.
however, after complie under 2005, Same program runs, the main menu didn't
show.
I use debugger to check , the process is hold during "frmMain.showdialog()
" and then done nothing .
Please Help ~~`
 
Agnes said:
I got a login form . When user input the correct password, the Main menu
will be shown.Everything works under .net 2003.
however, after complie under 2005, Same program runs, the main menu didn't
show.
I use debugger to check , the process is hold during
"frmMain.showdialog() " and then done nothing .

I suggest to post some code. Note that it doesn't make sense to show a main
form modally. Instead use 'Application.Run(frmMain)'.
 
I had a module ~~~
Module start_acct
Public objUser As dtsclass.objLoginUser
Public frmCheckUpdate As CheckUpdate

Sub Main() 'in a main module.

Dim flogin As New frmlogin_acct
flogin.frmCheckUpdate = frmCheckUpdate
flogin.ShowDialog() <-- I can show the login form

If flogin.pSuccessLogin Then <-- if use 's password is correct, Main
menu will show

Try
Dim frmMain As New frmMain_acct
frmMain.pObjUser = objUser
frmMain.frmCheckUpdate = frmCheckUpdate
frmMain.ShowDialog() <------ cannot show

catch

From Agnes
 
Agnes said:
Public objUser As dtsclass.objLoginUser
Public frmCheckUpdate As CheckUpdate

Sub Main() 'in a main module.

Dim flogin As New frmlogin_acct
flogin.frmCheckUpdate = frmCheckUpdate
flogin.ShowDialog() <-- I can show the login form

If flogin.pSuccessLogin Then <-- if use 's password is correct,
Main menu will show

Try
Dim frmMain As New frmMain_acct
frmMain.pObjUser = objUser
frmMain.frmCheckUpdate = frmCheckUpdate
frmMain.ShowDialog() <------ cannot show

catch

What's the problem? Simply replace the last line with
'Application.Run(frmMain)'. In addition to that you may want to remove the
'Try...Catch' error handling code. Maybe one of the lines in front of the
line marked with "cannot show" throws an exception and thus the marked line
is never executed.
 
Back
Top