Results 1 to 4 of 4

Thread: Closed form still running?

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2003
    Posts
    6

    Closed form still running?

    Hey people. I am laoding a form2 out of another form1:

    [...]
    Dim frm_make_media_popup_addpic = New frm_make_media_popup_addpic()
    Dim left As Int16, top As Int16
    left = Me.Left
    top = Me.Top
    frm_make_media_popup_addpic.Left = left
    frm_make_media_popup_addpic.Top = top
    frm_make_media_popup_addpic.ShowDialog()
    [...]

    not if i press back on the form1 (made by the following simple command

    [...]
    Me.Close()
    [...]

    Well so far so good...

    But If I now again try to load the form2 out of the form1 I cannot access form2 any more.

    (with the same code as I loaded the form2 the first time)

    In fact if I use the command

    [...]
    Me.Show
    [...]

    In form2 the real form2 appears where I am now able to access it

    But... why the hell is form2 still running? or did i sth else wrong?

    tom

    P.S.: Form2's task is to accept dragged images and display them - won't be the problem i suppose ;)

  2. #2
    Hyperactive Member
    Join Date
    Mar 2002
    Location
    Dublin (Ireland)
    Posts
    304
    just remember the difference between show and showdialog.

    If you use show then form2 will appear but form 1 can still respond to events.

    If I was right what you want to acheive is clicking on form 1, will close form 2 and some other action make it appear.

    using show always might help you to achieve that and use the event to call a public sub in form 2 which contains the me.close

    just a thought

  3. #3

    Thread Starter
    New Member
    Join Date
    Aug 2003
    Posts
    6
    Originally posted by RichardAtherton [/i]
    just remember the difference between show and showdialog.

    If you use show then form2 will appear but form 1 can still respond to events.

    If I was right what you want to acheive is clicking on form 1, will close form 2 and some other action make it appear.

    using show always might help you to achieve that and use the event to call a public sub in form 2 which contains the me.close

    just a thought

    ---------------------------

    no that's not the problem

    form2 is opened by form1

    I close form2 with a button on form2

    so i return to form1 - so it doesn't matter if i use show or showdialog here

    and after that i open form2 with a button on form1

    and now the problem appears

    tom

  4. #4

    Thread Starter
    New Member
    Join Date
    Aug 2003
    Posts
    6

    i got it

    Application.AddMessageFilter(Me)

    you have to end that before closing ya form with

    Application.RemoveMessageFilter(Me)

    tom

    P.S.: thx anyway!

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