我在 Windows Mobile 6.5 应用程序的 Windows 窗体中使用主菜单控件。它是经过编程的,所以如果我扫描条形码,程序会将我带到不同的页面。但是,如果我在主菜单打开时扫描页面,我将无法再在子屏幕上打开主菜单。我尝试在我的解码器事件(隐藏菜单)中对父表单执行“单击”,但菜单仍然不会显示在子屏幕上。如何让菜单在子屏幕上再次工作?如果扫描时菜单未打开,它工作正常。
Public Shared Sub DecodeEvent(ByVal sender As System.Object, ByVal e As HandHeldProducts.Embedded.Decoding.DecodeAssembly.DecodeEventArgs, ByVal scanInformation As ICurrentScanInformation, ByVal dashboardScreenServiceClient As DashboardScreenServiceClient)
Dim oDecodeAssembly As New DecodeAssembly
If scanInformation IsNot Nothing AndAlso scanInformation.AllowedScans IsNot Nothing Then
ShowOffenderDialog(scanInformation.ScreenName, CType(scanInformation, Form), sourceId, source, True, e.Message)
Else
MsgBox.ExclamationMsg("This type of barcode scan is not allowed.")
End If
End Sub
Public Shared Sub ShowOffenderDialog(ByVal parentScreenName As String, ByVal owner As Form, ByVal sourceId As System.Int32, ByVal source As System.String, ByVal scan As System.Boolean, Optional ByVal offenderCd As String = "")
Try
/*open up a new screen*/
offenderDetails = New frmOffenderDetails(parentScreenName, offenderCd, sourceId, source, scan)
offenderDetails.ShowDialog()
owner.BringToFront()
Catch ex As Exception
Utility.DisplayApplicationMessage(parentScreenName, "ShowDialog", ex)
End Try
End Sub
如果我跳过所有的 frmOffenderDetails 代码,菜单仍然不会显示,因此它与该表单没有任何关系。