Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

escape key option

Status
Not open for further replies.

d0s

Programmer
Apr 15, 2004
48
US
Hey...im trying to set my webbrowser to go to a certain site when the escape key is pressed..heres the code:
Code:
Protected Overrides Function ProcessDialogKey(ByVal keyData As Keys) As Boolean
        Dim nullObject As System.Object = 0
        Dim str As String = ""
        Dim nullObjStr As System.Object = str
        Dim b As String
        Dim sr As New StreamReader("C:\sma.hh")
        b = sr.ReadLine

        If keyData = Keys.Escape Then
            AxWebBrowser1.Navigate(b, nullObject, nullObjStr, nullObjStr, nullObjStr)
        End If

        Return MyBase.ProcessDialogKey(keyData)
    End Function
all it does is refresh the current site im at, well at least i think it does..shows a loading icon next to my cursor and makes a clicking noise..But anyone know why its not workin? the sma file holds the website address btw. Thanks
 
Lets break down the problem.

Replace:
Code:
If keyData = Keys.Escape Then
            AxWebBrowser1.Navigate(b, nullObject, nullObjStr, nullObjStr, nullObjStr)
        End If
With:
Code:
AxWebBrowser1.Navigate("[URL unfurl="true"]http://www.microsoft.com")[/URL]

And let us know what happened.
 
same thing...hear a click and see the loading icon and it just refreshes the current page
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top