Results 1 to 3 of 3

Thread: 1)Disable tabindexability + 2) pass events to 2 controls

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2000
    Location
    London
    Posts
    290

    Post

    Hi,

    2 probs here!

    1)
    I have a form with many controls on ... I have numbered the ones I want to tab between from 0, but there is an extra control between the last and the first which is a button (actually an array of them).

    Is there any way of removing that/them from the tabindex array, so that control passes straight back to the first control?

    2)
    I want to be able to press a function key at any time/place on the form. When the form gets loaded/activated/shown, then no problem. Once i am tabbing between controls and entering data, i want to be able to press F2 (for example), to save progress at any time.
    At the moment i have a `keydown` event handler for each of the controls that i tab between...this is horrible (and its in addition to the list of `change` events that i`m also using).
    Is there anyway of getting fkeys checked as a special case, or any group of keys (i can see the problem if every keypress to a text control is sent to multiple event handlers).

    Hope someone can help with either of these little probs...

    Alex.

  2. #2
    Frenzied Member Buzby's Avatar
    Join Date
    Jan 1999
    Location
    UK
    Posts
    1,670

    Post

    1. Switch the TabStop property to FALSE for any items you don't want be included in the Tab Order.

    2. Set the Form's KeyPreview property to True, then use the Form's KeyDown event to catch the F2 key. Setting the KeyPreview property to True means that the form gets the keypress before the controls do.



    ------------------
    Mark "Buzby" Beeton
    VB Developer
    [email protected]



  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2000
    Location
    London
    Posts
    290

    Post

    >1. Switch the TabStop property to FALSE for
    >any items you don't want be included in the
    >Tab Order.

    Cool. Worked this one out eventually.

    >2. Set the Form's KeyPreview property to
    >True, then use the Form's KeyDown event to
    ...

    Thanks for this one - used it to replace about 50 subroutines with 4! Nice one.

    Thanks again,
    Alex.


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