Blogs

Mehul Harry's DevExpress Blog

Visual Studio Tip: Search DevExpress From IDE

     

Video: Search DevExpress In Visual Studio

Check out this 5 minute Visual Studio search integration video.

The screencast shows how to:

  • Create a Visual Studio macro
  • Call DevExpress Search
  • Search selected words!! Smile
  • Assign a keyboard shortcut
  • Add a toolbar icon

I love Visual Studio tweaks and tips, this one is super easy and useful.

What's your favorite VS tweak?

Click the image and watch the video. Then drop me a line here and tell me how much you love this tip.

Published Apr 13 2009, 03:05 PM by Mehul Harry (DevExpress)
Bookmark and Share

Comments

 

Rory Becker - DevExpress said:

I use Autohotkey (http://www.autohotkey.com/) with the following scriptlets ....

;-------------------------------------------------------------------------------
; This first one searches Google when I use Ctrl+Shift+C
;-------------------------------------------------------------------------------

^+c::
{
Send, ^c
Sleep 50
Run,% "www.google.com/search?q=%22" . clipboard . "%22"
Return
}

;-------------------------------------------------------------
; This next searches DevExpress when I use Ctrl+Shift+D
;-------------------------------------------------------------

^+d::
{
Send, ^c
Sleep 50
Run,% "http://Search.DevExpress.com?q=%22" . clipboard . "%22"
Return
}

;-------------------------------------------------------------

These work with the highlighted text from anywhere in windows. :)

April 14, 2009 8:21 AM
 

Neal said:

This is a great tip, however, if you call this macro when in the Form Designer (not code document) you'll get an error!  Woops! :)

April 14, 2009 9:27 AM
 

heather said:

Hi Mehul,

Great post as usual.  I have a couple of options for people that want to launch the results in a new browser outside of VS.  Working with multiple monitors it is more productive at times to have reference materials in separate windows.

You can replace the two lines in the DXSearch macro with the following:

Diagnostics.Process.Start("firefox.exe", "search.devexpress.com & DTE.ActiveDocument.Selection.Text)

This will launch the search result in firefox.  Of course if you want to use IE...then change it to: iexplore.exe.

I also use this same technique for searching google with a focus on microsoft.  You can just create another sub in your search macros to include this.  Here is the macro command for that.

Diagnostics.Process.Start("firefox.exe", "www.google.com/microsoft & DTE.ActiveDocument.Selection.Text)

As far as external favorites go...this probably is one of favorites, simple but I use it all the time:

it.toolbox.com/.../visual-studio-macro-collapse-solution-explorer-18035

It closes the solution explorer outline...you know how that gets on large projects.

One more point to remember if you have any errors whatsoever in any of your macros, across subs, across classes, etc...none of your macros will work.  For people just getting into macros if your macros all of sudden stop functioning go into your latest macro changes and comment them out and slowly add them back until you find the problem.

April 14, 2009 10:20 AM
 

Mehul Harry (DevExpress) said:

Rory,

I love AutoHotkey. I'll add that to my list as well.

April 14, 2009 2:33 PM
 

Mehul Harry (DevExpress) said:

Glenn,

Great tips! Love that there is a FF option as well as the internal VS browser. Smile

Thanks.

April 14, 2009 2:34 PM
 

Mehul Harry (DevExpress) said:

Hi Neal,

The error is because the Selection object is empty. A quick check fixes this:

Public Module DevExpress

   Sub DXSearch()

       DTE.ExecuteCommand("View.WebBrowser")

       If (DTE.ActiveDocument.Selection is Nothing) Then

           DTE.ExecuteCommand("View.URL", "search.devexpress.com/")

       Else

           DTE.ExecuteCommand("View.URL", "search.devexpress.com + DTE.ActiveDocument.Selection.Text)

       End If

   End Sub

End Module

April 14, 2009 4:29 PM
 

heather said:

This information is great.  It would be fantastic if you guys put up a section on the customer forums where you could discuss tips, etc based on different topics:

i.e. VS2008/macros

another idea would be to include sections like:

ASPxGridView/scripts/column manipulation

April 14, 2009 8:08 PM
 

Palak said:

Hi Mehul,

I tried creating this macro on VS 2005 and then using it in my WinForms app's code behind but it didn't open up any browser. Does this work only for ASP.NET apps? (I don't think it would be limited to that but no such thing as a stupid question right?)

Thanks

May 5, 2009 4:52 PM
 

Mehul Harry (DevExpress) said:

Hi Palak,

Check out my reply to Neal for the WinForms approach.

May 5, 2009 5:02 PM
 

Debabrata Bhaumik said:

function AutoSuggestControl(oTextbox /*:HTMLInputElement*/, oProvider /*:SuggestionProvider*/)

{

   this.cur /*:int*/ = -1;

   this.layer = null;

   this.provider /*:SuggestionProvider*/ = oProvider;

   this.textbox /*:HTMLInputElement*/ = oTextbox;

   this.init();

}

The error I am getting is in line "this.init();", the error is "Microsoft JScript runtime error: Object doesn't support this property or method". PLEASE HELP, and THANKS IN ADVANCE

October 19, 2009 4:18 AM
 

geo mwe said:

great work Harry!!

January 4, 2010 8:10 AM

About Mehul Harry (DevExpress)

Mehul Harry is an ASP.NET technical evangelist at Developer Express. You can reach him directly at mharry@DevExpress.com. You can also follow him on Twitter: http://twitter.com/mehulharry
More from DevExpress
Live Chat
Have a pre-sales question?
Need assistance with your evaluation?
We are here to help.
Chat is one of the many ways you can contact members of the DevExpress Team. We are available Monday-Friday between 8:30am and 5:00pm Pacific Time.
If you need additional product information, require pre-sales assistance, or want help with your order, write to us at info@devexpress.com or call us at
+1 (818) 844-3383.