Navigation buttons

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lotus18
    Contributor
    • Nov 2007
    • 865

    Navigation buttons

    Hello World


    My client wants to me to add navigation keys for the MDIChild forms (Just like a Windows Explorer). When using CTRL + F6 it would go to the next form again and again. My problem is, how can I make disable the buttons (next or back) if I reached the first or the last form? Any ideas? Thanks : )


    Rey Sean
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    is your number of child forms fixed ?

    Comment

    • lotus18
      Contributor
      • Nov 2007
      • 865

      #3
      Originally posted by debasisdas
      is your number of child forms fixed ?
      What do you mean by fixed? I really have no idea about that : )

      Comment

      • Ali Rizwan
        Banned
        Contributor
        • Aug 2007
        • 931

        #4
        Originally posted by lotus18
        Hello World


        My client wants to me to add navigation keys for the MDIChild forms (Just like a Windows Explorer). When using CTRL + F6 it would go to the next form again and again. My problem is, how can I make disable the buttons (next or back) if I reached the first or the last form? Any ideas? Thanks : )


        Rey Sean
        In Explorer explorer only saves a fixed number of contents.
        So declare an array or insert a list control or do some thing like that and when you open a form on its load event saves its name in that array or menu and so on. When ever u click on back it opens the last form getting his id or name from the history list and move that item to previous navigation list. I think this will help if you want some more help plz tell me so that i ll make an example for you.

        Regards
        >> ALI <<

        Comment

        • lotus18
          Contributor
          • Nov 2007
          • 865

          #5
          Originally posted by Ali Rizwan
          In Explorer explorer only saves a fixed number of contents.
          So declare an array or insert a list control or do some thing like that and when you open a form on its load event saves its name in that array or menu and so on. When ever u click on back it opens the last form getting his id or name from the history list and move that item to previous navigation list. I think this will help if you want some more help plz tell me so that i ll make an example for you.

          Regards
          >> ALI <<
          OK Ali, can you give me an example for this one?

          Comment

          • Killer42
            Recognized Expert Expert
            • Oct 2006
            • 8429

            #6
            Originally posted by lotus18
            My client wants to me to add navigation keys for the MDIChild forms (Just like a Windows Explorer). When using CTRL + F6 it would go to the next form again and again. My problem is, how can I make disable the buttons (next or back) if I reached the first or the last form? Any ideas? Thanks : )
            If the user can switch from the last to the first form directly by using the mouse, then maybe you shouldn't disallow it through the keyboard.

            But in any case, how about this...

            Let's say you have five child forms, called Form1 through Form5.
            Create a public variable, let's say LastForm.

            In each form's Deactivate event procedure, set LastMsg to Me.Name.
            In the Activate event procedure for Form2, do something like...
            If LastForm = "Form5"
            Form5.Show
            End If

            And something similar, though reversed, in Form5.

            This is probably an ugly way of going about it, but seems to work.

            Comment

            Working...