Results 1 to 6 of 6

Thread: [RESOLVED] Pause and Resume

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2005
    Location
    England
    Posts
    79

    Resolved [RESOLVED] Pause and Resume

    I have a chunk of code running...

    Now I have added a bit which makes Form2 display, and the user has to select some information from there which will be sent back to Form1.

    Now my problem is this...

    When Form2 displays, the code after loading Form2 within Form1 still runs... Is there a way to pause it, and only let it resume once the information from Form2 has been passed back?

    If you need any further details on what I'm talking about, please just say.

    Cheers.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Pause and Resume

    If you use ShowDialog to display a form then the caller blocks until the function returns, i.e. the dialogue is dismissed. Notice that I say dismissed rather than closed. You normally dismiss a dialogue form by setting it's DialogResult property. This is more like calling Hide than calling Close because the form is not disposed.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    Re: Pause and Resume

    Use Form2.ShowDialog() instead of Form2.Show()
    I don't live here any more.

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Jul 2005
    Location
    England
    Posts
    79

    Re: Pause and Resume

    Perfect!

    Works a charm.

  5. #5
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [RESOLVED] Pause and Resume

    Woohoo! Dead heat. I think I just got in first because J is before W. You need to change your name to aaaaaaaaawossname.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  6. #6
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [RESOLVED] Pause and Resume

    Woohoo! Dead heat again.

    For God's sake will I just grow up.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

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