Results 1 to 3 of 3

Thread: [RESOLVED] [2005] Closing a Form not in Focus

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2006
    Location
    UK
    Posts
    489

    Resolved [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:
    1. My.Forms.GreyOut.Focus()
    2.         My.Forms.GreyOut.Close()
    3.  
    4.         Me.Close()

    vb Code:
    1. GreyOut.Close()
    2.         Me.Close()

    But so far, I havent been able to close it
    Learning C♯

    Data Binding & Bound Controls - Objects and wizards will never be as intelligent as you, do it yourself! (Unless your Pro)

  2. #2
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    Re: [2005] Closing a Form not in Focus

    Show us the block of code where you are showing these two forms.
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2006
    Location
    UK
    Posts
    489

    Re: [2005] Closing a Form not in Focus

    Well I open them using this

    vb Code:
    1. Private Sub btnsearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnsearch.Click
    2.         If txtsearch.Text = String.Empty Then
    3.             Dim GreyOut As New GreyOut
    4.             GreyOut.Show()
    5.             Dim msgbox As New MsgboxForm
    6.             msgbox.lblerrormessage.Text = "Please enter a key word into the search text box"
    7.             msgbox.Show()
    8.         Else
    9.             btnsearch.Cursor = Cursors.WaitCursor
    10.             Call RetriveDatabaseProducts()
    11.             btnsearch.Cursor = Cursors.Default
    12.         End If
    13.     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.
    Last edited by Bopo; Feb 24th, 2008 at 12:13 PM.
    Learning C♯

    Data Binding & Bound Controls - Objects and wizards will never be as intelligent as you, do it yourself! (Unless your Pro)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width