Results 1 to 2 of 2

Thread: hard to explain - showing forms one after another

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2000
    Location
    Sydney, Australia
    Posts
    196

    Question

    It was hard to describe in a one line subject...

    anyway, i have a series of forms that i show one after the other - the user can navigate from one form to the next by clicking the "Next >>" button, and go to the previous form by pressing the "<< Previous" button. I want all these forms to be displayed vbModally in the sense that the user should not be able to click back to the main form whilst any of these Previous/Next type forms are displayed.

    So, lets say i have forms frmA, frmB, and frmC. Then on the Next_Click event for for frmA - i do a "frmB.show vbModal"

    and on frmB if the user clicks "<< Previous" i do a "frmA.Show vbModal"

    but it is a bit clumsy because the calls to the .Show method do not return straight away seeing as though i am using vbModal. Yuo could potentially end up with many many nested calls and blow the stack <i know this is a far remote chance that you could reasonably ignore - but it is a possibility>

    what i would prefer is a way to just show the form so that no others can be clicked on BUT allow the code from the calling form (the one that called the .Show method) to continue to completion.

    Does anyone know of the professional way to link a whole heap of forms with previous/next functionality - the sort of thing you see in wizards etc where a whole heap of questions are asked and the user can go back and forth between forms.

    Thanks,

    Mark

  2. #2
    Lively Member
    Join Date
    Jul 2000
    Location
    Vaxjo, Sweden
    Posts
    85
    I assume you are trying to make a wizard of some sort? I would suggest using one form with all your stuff in different frames, if you get what I mean. When the user clicks Next or Previous, you just show the apropriate form. This also gives you more control over what the user has input.

    But if you must use multiple form, her another suggestion:
    Call the forms from the main form, and make it have a return value which tells you which form to load next. Then loop this untill you get a certain return value, from that the user have pressed Cancel or Ok.

    //Anders
    Reality is what you make up when you can't handle your fantasies.

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