Problem with the closing event of a form in VB.Net using compact framework for Pocket PC

W

Wiggum

I have this in the closing event of Form3:

Private Sub Form3__Closing(ByVal sender As Object, ByVal e As
System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
MsgBox("Closing",MsgBoxStyle.OKOnly)
End Sub

PROBLEM: There is no MsgBox showing when I close Form3 by clicking the
X in the upper right and I do not know why.

For some history to this (and potential source of the problem) I have
created the following class to prevent mutiple instances of forms from
opening:

Public Class clsGlobals
#Region "Singleton Forms"
Public Shared Form1 As Form1
Public Shared Form2 As Form2
Public Shared Form3 As Form3
#End Region
End Class

In Form2, for example, I call Form3 as follows:
If clsGlobals.Form3 Is Nothing Then
clsGlobals.Form3 = New Form3
End If
clsGlobals.Form3.Show()
clsGlobals.Form3.Focus()

Can anyone explain what is going on with my closing event and how to
fix it?

Thanks

PB
 
W

Wiggum

Hi

Figured it out from another topic in here. The X is only a minimize
button I need the Ok button to close

Please ignore the question.

Thanks

PB
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top