Results 1 to 5 of 5

Thread: Getting key press

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2004
    Location
    Can't say sorry :)
    Posts
    79

    Getting key press

    How do you get a key press from a text box (Example: Enter)?

    How would you get the last URL from a string (like clicking back button) same goes for forward.

    Any help appreciated.



  2. #2
    PowerPoster SuperSparks's Avatar
    Join Date
    May 2003
    Location
    London, England
    Posts
    265
    Here's how to get the keypress:

    VB Code:
    1. Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
    2.  
    3.         If e.KeyChar = Convert.ToChar(Keys.Enter) Then
    4.             MessageBox.Show("Enter was pressed", "Key Pressed", MessageBoxButtons.OK, MessageBoxIcon.Information)
    5.             e.Handled = False
    6.         Else
    7.             e.Handled = True ' don’t allow any other keys.
    8.         End If
    9.     End Sub
    Nick.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jul 2004
    Location
    Can't say sorry :)
    Posts
    79
    Ok, thanks. Now, anyone for the webbrowser back button?

    In the mean time, I am going to read some tutorials.



  4. #4
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704
    you can get a complete history using javascript, because history resides on the client-side.

    However, you can get referUrl of the HttpRequest (or its the Response don't remember offhand), to tell which page brought you to the current page.....

    You could also log every request made from a particular session, but ultimately thats rather clunky.

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Jul 2004
    Location
    Can't say sorry :)
    Posts
    79
    Ok *takes notes*. If anyone know's any other way. Let me know.



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