Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. sendkeys.send("{BS}")

sendkeys.send("{BS}")

Scheduled Pinned Locked Moved Visual Basic
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    vertig0730
    wrote on last edited by
    #1

    I want to send this to a textbox but when i put it in a button_click It doesnt work. I need to link it to the textbox but i cant fingure it out. James Kennelly

    D 1 Reply Last reply
    0
    • V vertig0730

      I want to send this to a textbox but when i put it in a button_click It doesnt work. I need to link it to the textbox but i cant fingure it out. James Kennelly

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      You must give the focus to the control you want to send the keystrokes to. Using this method isn't recommended because it's not a completely reliable way to send keystrokes. In order for it to work, you must give the application/control the focus, then send the keystrokes. But, in a multitasking environment like Windows, the focus can move from control to control and application to application at any time. This includes the time between when you set the focus and the time you send the keystrokes, even if SendKeys is the very next statement! RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

      V 1 Reply Last reply
      0
      • D Dave Kreskowiak

        You must give the focus to the control you want to send the keystrokes to. Using this method isn't recommended because it's not a completely reliable way to send keystrokes. In order for it to work, you must give the application/control the focus, then send the keystrokes. But, in a multitasking environment like Windows, the focus can move from control to control and application to application at any time. This includes the time between when you set the focus and the time you send the keystrokes, even if SendKeys is the very next statement! RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

        V Offline
        V Offline
        vertig0730
        wrote on last edited by
        #3

        well ginving the text box focus works i only need it for a second. But it wipes out the entire contents of the textbox because of the focus it selects all. so had to play a game and came up with TextBox1.Focus() SendKeys.Send("{right}") SendKeys.Send("{backspace}") works so I like it! James Kennelly

        D 1 Reply Last reply
        0
        • V vertig0730

          well ginving the text box focus works i only need it for a second. But it wipes out the entire contents of the textbox because of the focus it selects all. so had to play a game and came up with TextBox1.Focus() SendKeys.Send("{right}") SendKeys.Send("{backspace}") works so I like it! James Kennelly

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          vertig0730 wrote: well ginving the text box focus works i only need it for a second. That's what I thought too... until it hit production! Out of 15,000 machines, some are garanteed to find that little second and mess it up for you. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

          V 1 Reply Last reply
          0
          • D Dave Kreskowiak

            vertig0730 wrote: well ginving the text box focus works i only need it for a second. That's what I thought too... until it hit production! Out of 15,000 machines, some are garanteed to find that little second and mess it up for you. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

            V Offline
            V Offline
            vertig0730
            wrote on last edited by
            #5

            good news I am only intstalling it on 1 machine so i like the odds. James Kennelly

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups