Results 1 to 7 of 7

Thread: Adding Sub To Webbrowser Control

  1. #1
    rsitogp
    Guest

    Adding Sub To Webbrowser Control

    Hello,

    I wanted to add a keypress sub to the webbrowser control but it doesn't seem to work. Here's my code:
    Code:
    Private Sub WebBrowser1_KeyPress(KeyAscii As Integer)
    If KeyAscii = 13 Then
      MsgBox "NO ENTER PLEASE!"
    End If
    End Sub
    Please help!

    Thanks In Advance!

  2. #2
    rsitogp
    Guest
    someone, anyone, everyone?

  3. #3
    Matthew Gates
    Guest
    Use the GetAsyncKeyState API function.

  4. #4
    Matthew Gates
    Guest
    Here's an example of how to use it.


    Code:
    Private Declare Function GetAsyncKeyState Lib "user32.dll" _
    (ByVal vKey As Long) As Integer
    
    
    Private Sub Timer1_Timer()
        If GetAsyncKeyState(vbKeyReturn) Then Msgbox "NO ENTER PLEASE!"
    End Sub

  5. #5
    rsitogp
    Guest
    Is there another way, I don't want to check the whole time, only when enter is pressed in the webbrowser, because there are other places on the form, and there is no order of data entry or something of the sort.

  6. #6
    Addicted Member csammis's Avatar
    Join Date
    Mar 2001
    Location
    /dev/null
    Posts
    226
    If the WebBrowser control doesn't support an event in the dropdown list, IMHO there's no way to *make* it...you have to use workaround API calls
    Things I've Said:
    "Life's funny like that...elephants can wear frilly lace panties, and Dubya still looks like a monkey in a big chair"
    "Take four goats and strap one to each foot of a llama. Presto, goat-powered llama!"
    "You want to get me to work more, get me a Coke. No? Then deal with inferior garbage, I'm not coding another line and your clients can go to......thanks, I'd love a Coke right about now!"

  7. #7
    rsitogp
    Guest
    I know it's a big question but can i subclass it somehow?

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