Visual Studio Tip: Search DevExpress From IDE

13 April 2009

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.

11 comment(s)
Rory Becker - DevExpress

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. :)

14 April, 2009
Neal

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! :)

14 April, 2009
heather

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.

14 April, 2009
Mehul Harry (DevExpress)

Rory,

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

14 April, 2009
Mehul Harry (DevExpress)

Glenn,

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

Thanks.

14 April, 2009
Mehul Harry (DevExpress)

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

14 April, 2009
heather

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

14 April, 2009
Palak

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

5 May, 2009
Mehul Harry (DevExpress)

Hi Palak,

Check out my reply to Neal for the WinForms approach.

5 May, 2009
Debabrata Bhaumik

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

19 October, 2009
geo mwe

great work Harry!!

4 January, 2010

Please login or register to post comments.