Home All Groups Group Topic Archive Search About

.net 2005 cannot show menu !

Author
11 Feb 2006 9:21 AM
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 ~~`

Author
11 Feb 2006 11:43 AM
Herfried K. Wagner [MVP]
"Agnes" <ag***@dynamictech.com.hk> schrieb:
>   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)'.

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>
Author
12 Feb 2006 4:13 AM
Agnes
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
"Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at>
???????:ectjgBwLGHA.1***@tk2msftngp13.phx.gbl...
Show quoteHide quote
> "Agnes" <ag***@dynamictech.com.hk> schrieb:
>>   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)'.
>
> --
> M S   Herfried K. Wagner
> M V P  <URL:http://dotnet.mvps.org/>
> V B   <URL:http://classicvb.org/petition/>
Author
12 Feb 2006 12:35 PM
Herfried K. Wagner [MVP]
Show quote Hide quote
"Agnes" <ag***@dynamictech.com.hk> schrieb:
>    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.

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>