Results 1 to 5 of 5

Thread: [2008] Binding Keys

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Dec 2007
    Posts
    167

    [2008] Binding Keys

    so if you press the Tab key, you move to the next index (for textbox1 to textbox2 to textbox3....)
    and if you press Ctrl+V you paste ofcourse.
    Can I bind these 2 keys so that when the user presses Tab, it actually moves to the next index and pastes the clipboard to the testbox ?
    if yes, how ?

    Thanks
    Im using Visual Studio 2008 Professional Edition
    .Net Framework 3.5

  2. #2
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,424

    Re: [2008] Binding Keys

    you could try it this way

    vb Code:
    1. Private Sub TextBox1_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyUp
    2.      If e.KeyCode = Keys.Tab Then
    3.          TextBox2.Text = Clipboard.GetText
    4.      End If
    5. End Sub
    6.  
    7. Private Sub TextBox2_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox2.KeyUp
    8.      If e.KeyCode = Keys.Tab Then
    9.          TextBox3.Text = Clipboard.GetText
    10.      End If
    11. End Sub

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Dec 2007
    Posts
    167

    Re: [2008] Binding Keys

    oh no no no, I didnt explain well it seems, I want to do this globally, not in my application, wherever my application is running and the user presses TAB, it should also pastes, I think I should track down the TAB key and send the paste command for the focued window, but I'm not sure how to do it...
    any help?
    Im using Visual Studio 2008 Professional Edition
    .Net Framework 3.5

  4. #4
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,424

    Re: [2008] Binding Keys

    i think you can use sendmessage API with WM_PASTE.
    i've tried googling for your other thread. i found this - http://www.codeguru.com/forum/showth...hreadid=343977
    its done in c++. you might be able to translate it

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Dec 2007
    Posts
    167

    Re: [2008] Binding Keys

    I did already check that thread, thx anyway
    I was thinking of following the method we're using in the Tracking Clipboard thread here, ie track TAB and then use SendMessage API, the problem as I said in that thread, is when Im registering Ctrl V or Tab as a hotkey, its losing its orginal function...
    Im using Visual Studio 2008 Professional Edition
    .Net Framework 3.5

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