[RESOLVED] [2005] Closing a Form not in Focus
Hi
Right I have two forms appear when a certain action is performed, one form is purley for visual effects and another displaying an error message. Once the error message form is closed, I would also like to close the other form, however it will not close, I have tried
vb Code:
My.Forms.GreyOut.Focus()
My.Forms.GreyOut.Close()
Me.Close()
vb Code:
GreyOut.Close()
Me.Close()
But so far, I havent been able to close it :cry:
Re: [2005] Closing a Form not in Focus
Show us the block of code where you are showing these two forms.
Re: [2005] Closing a Form not in Focus
Well I open them using this
vb Code:
Private Sub btnsearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnsearch.Click
If txtsearch.Text = String.Empty Then
Dim GreyOut As New GreyOut
GreyOut.Show()
Dim msgbox As New MsgboxForm
msgbox.lblerrormessage.Text = "Please enter a key word into the search text box"
msgbox.Show()
Else
btnsearch.Cursor = Cursors.WaitCursor
Call RetriveDatabaseProducts()
btnsearch.Cursor = Cursors.Default
End If
End Sub
However just to note, the 'GreyOut' form has no borders or anything, I cant even close it via right clicking the form on the Start menu bar, mabe this could be the problem?
EDIT: Just tested, yeah that seems to be the problem, I will just enable/change properties to see which is causing the problem.