Add the Google toolbar to vs. net!

Source: Internet
Author: User
Google is the most widely used search engine. How can we build it into vs. Net? The Macro of Visual Studio. NET is used here, And the built-in Google Toolbar can be embedded in vs. net.

Create a new modle (in mymacros project) in the macro Editor (Alt + F11 open) of vs. net ),CodeSearch. VB

Imports Envdte
Imports System. Diagnostics
Imports System. Windows. Forms
Imports System. Globalization
Public   Module Search
Public   Sub Google ()
Navigateto ( " Http://www.google.com/search? Q = {0} " )
End sub

Private   Sub Navigateto ( Byval URL As   String )
Dim Selection As   String   = DTE. activedocument. selection. Text
If Selection. Length >   0   Then
DTE. itemoperations. navigate ( String . Format (Cultureinfo. invariantculture, URL, selection), vsnavigateoptions. vsnavigateoptionsnewwindow)
Else
MessageBox. Show ( " No search text selected. " )
End   If
End sub

End Module 

Add this macro to the toolbar.
For more information, see Add a search engine toolbar to vs. Net on dotnetjunkies.

Supported Chinese characters:
DTE. itemoperations. navigate (string. Format (cultureinfo. invariantculture, URL,System. Web. httputility. urlpathencode (selection )),Vsnavigateoptions. vsnavigateoptionsnewwindow)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.