SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Thread: VB: Modal Forms

  1. #1
    SitePoint Enthusiast
    Join Date
    Nov 2006
    Posts
    50
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    VB: Modal Forms

    Hi,

    This is in VB and My scenario is like this.

    1. i have MainForm, Form1 and Form2.
    2. When i click a button on MainForm it show Form1.
    3. Then when i click on a button in Form1 it show Form2.
    4. When i click on button at Form2, i want it to show the Form1 again.

    However, i encountered error if i continue to use Form1.ShowDialog() because Form1 is visible.

    Forms can be easily show up if i use modeless form. But i need the modal feature like disable to edit Forms behind the form on top.

    How do i show the Form1? Please advise. Thank you.

    Regards,
    ChunKet

  2. #2
    SitePoint Zealot
    Join Date
    Jun 2003
    Location
    NJ
    Posts
    114
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    In Form2, use Me.Close() which will close it so that you will be back at Form1.

  3. #3
    SitePoint Enthusiast
    Join Date
    Nov 2006
    Posts
    50
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    My idea is like displaying both Form and switching to front whenever it click.

    I have an idea but its not work which might because it is modal form. But It works in modeless form.

    Form2.SendToBack()
    Form1.BringToFront()

    or just simply Form1.Show() then the form behind the first Form will bring to front.

    Any idea on it?

  4. #4
    SitePoint Zealot
    Join Date
    Jun 2003
    Location
    NJ
    Posts
    114
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm not sure why you are so keen on modal.

    If you can find a way to make it work modeless, then use it.

    Am I missing something here?

  5. #5
    SitePoint Enthusiast
    Join Date
    Nov 2006
    Posts
    50
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok. i've got it. Thanks.


Bookmarks

Posting Permissions

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