focus

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • jdrott1

    #1

    focus

    I'm trying to input letters from a button into a couple different
    textboxes. fields such as: firstname, lastname, address, phone
    number.
    so the focus can't be set to that textbox always. if they want to
    type into the lastname box, then i would have to find where the focus
    is?

    a friend of mine wrote:

    "when you "click" the button, the focus shifts to that button so
    you're
    going to have to manually figure out which textbox had focus before
    you button click (maybe set a variable whenever a textbox gets focus
    as there is an OnFocus event you can use)"

    i'm not quite sure how to do this, can someone help me?

  • Parag Joshi

    #2
    Re: focus

    There is a Focussed property that tells you if a control has input focus.You
    could iterate through all the controls on a form or just check the ones you
    want to check if they have input focus. I am not sure if you are trying to
    check from within one routine or multiple. If you are only checking from
    within one control click event then its much easier. You just check which of
    the 10 controls has input focus and act accordingly.

    I guess you are using VS 2005?

    "jdrott1" <jonathandrott@ gmail.comwrote in message
    news:1176324104 .548656.286430@ y5g2000hsa.goog legroups.com...
    I'm trying to input letters from a button into a couple different
    textboxes. fields such as: firstname, lastname, address, phone
    number.
    so the focus can't be set to that textbox always. if they want to
    type into the lastname box, then i would have to find where the focus
    is?
    >
    a friend of mine wrote:
    >
    "when you "click" the button, the focus shifts to that button so
    you're
    going to have to manually figure out which textbox had focus before
    you button click (maybe set a variable whenever a textbox gets focus
    as there is an OnFocus event you can use)"
    >
    i'm not quite sure how to do this, can someone help me?
    >

    Comment

    Working...