|
Question : VB.NET Smart Device Application - Form doesn't show using form.show() method
|
|
I'm writing a very simple program for a Smart Device (Pocket PC version 4.20.0). The program was working fine, and then I decided to add another form (Splash) for a splash screen. In theory, the user enters a userID (three digit number), clicks on a button, and loads the main form (frmPDASAL) as long as the userID is anything from 1 to 999.
The code is as follows:
Private Sub btnProceed_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnProceed.Click '// The user ID is a number between 1 and 1000 If Not (IsNumeric(Me.txtUserID.Text)) Then Beep() Me.txtUserID.Text = "" Exit Sub End If
If Me.txtUserID.Text < 1 Or Me.txtUserID.Text > 999 Then Beep() MessageBox.Show("Invalid ID", "Login Error") Me.txtUserID.Text = "" Exit Sub End If
intUserID = Me.txtUserID.Text '//THIS IS A GLOBAL VARIABLE IN ANOTHER MODULE
Dim frm As New frmPDASAL frm.Show() frm.BringToFront() Me.Close()
End Sub
However, the frmPDASAL never appears. Debugging shows that the "Dim frm as New frmPDASAL" line goes directly into the frmPDASAL.vb module, as it probably should, creating and setting control properties. It then exits back the "frm.Show()" without incident, then the BringToFront line, and then Me.Close, at which point the program terminates.
The form name frmPDASAL is spelled correctly, and was presented for choice in the context menu while typing. If I replace "Me.Close" with "Me.SendToBack", it just sits there on the splash screen. This happens both when deploying to the PDA itself and Pocket PC 2002 emulator.
I'm probably doing something really stupid, but I can't figure it out.
|
|
Answer : VB.NET Smart Device Application - Form doesn't show using form.show() method
|
|
|
|
|
|