Form not closing

ripon

Member
Joined
Mar 23, 2006
Messages
15
Programming Experience
Beginner
Hi:
In my one form I have a cancel button whcih is supposed to the form when the button is clicked. But its not closing the form. What could be possible reasons. I am using VS2008.Net3.5

The code is:
Private Sub cbCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cbCancel.Click

callingTextBox = Nothing
txtNumber.Text = Nothing
CapsInfo.setActiveForm(callingForm)
Hide()---I also tried Mybase.Hide() and MyBase.Close()
callingForm.Refresh()
callingForm.Show()

End Sub

Thanks in advance
Ripon
 
Me.Close closes the form, how can it not work? Do you have anything in the FormClosing event that would cancel it?
 
In the FormClosing event, I just have MyBase.Close.

The button code first tries to hide the form. But its NOT hiding the form.
The code works perfect in VS2003. We are updating it VS2008. But does not work. See the button code:
Private Sub cbCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cbCancel.Click

callingTextBox = Nothing
txtNumber.Text = Nothing
CapsInfo.setActiveForm(callingForm)
Hide()---I also tried Mybase.Hide()
callingForm.Refresh()
callingForm.Show()

End Sub
 
Back
Top