Results 1 to 4 of 4

Thread: setfocus

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2000
    Location
    Australia
    Posts
    69

    Unhappy

    Hi everybody...I hope this is a easy one.

    Basically I want a particular control (textbox) to gain focus when a commanfd button is clicked as follows:

    txtDemo(3).Enabled = True
    txtDemo(3).SetFocus
    SendKeys "{Home}+{End}"

    It doesn't work!! The text box does not have the focus..help


    Gerard
    Live long and prosper...

  2. #2
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    Works fine for me.
    It has focus and seltext is len(textbox)

    Any messages or anything?
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jul 2000
    Location
    Australia
    Posts
    69

    Unhappy

    Yeah it should work but it never does for me..I'm not sure if there is some other environmental settting that is causing me grief!!
    Live long and prosper...

  4. #4
    Hyperactive Member Asaf_99's Avatar
    Join Date
    Jul 2000
    Location
    Israel
    Posts
    335
    Yeah, that occurs to me either!
    I had to do:
    txtSearch.TabIndex = 0
    in Form_Load.
    That's not going to work with a command button.
    Asaf Sagi

    ICQ: 61917199
    E-Mail: sagiasaf@netvision.net.il

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