Thursday, April 7, 2011

When the user presses "Enter" in a ToolStripTextBox (VB.NET)

I have a ToolStripTextBox (the name of it is SearchBox) and I would like it when after the user types something and presses enter it takes them to a URL. I've got the URL part sorted out, but I need to know what goes after

Handles SearchBox.{what?}

I don't see any event in the intellisense popup for something when the user presses "enter."

So, in other words, how do I perform an action after the user presses enter?

    Private Sub ToolStripComboBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SearchBox.**?????**

    Dim SearchString As String
    SearchString = SearchBox.Text

    Dim URL As String
    URL = ("https://www.example.com/search.php?&q=" + SearchString)

    Process.Start(URL)
End Sub
From stackoverflow

0 comments:

Post a Comment

Note: Only a member of this blog may post a comment.