.NET Answers

ASP.NET, HTML, CSS, Visual Studio, CSharp, VB.NET and other programming items of interest.
Subscribe
  • Home
  • About Me
  • Advertising
  • Click Here to Ask a question
    • Privacy Policy
  • Site Map

Easily Find Classes, Methods, and Variables

November 17, 2008 By: Dave

I02B0065 There is a bit of a “trick” that I use routinely in Visual Studio to help me find the definition of Classes, Methods, and Variables in my solution regardless.

This “trick” works in both CSharp and in VB.NET and, if you don’t know it already, will save you a ton of time.

If you want to know the type of a variable, obviously all you need to do is hover your mouse over it, but if you want to know the definition of the class that your variable is defined as, what do you do?

My bet is that many of you are searching for the class in the solution explorer.

Instead, you can do this:

  • Right click on the variable name.
  • Select “Go To Definition”  from the resulting context menu.
  • This will place you on the variable declaration line.
  • Right-click the class name on the variable declaration line.
  • Select “Go To Definition” from the resulting context menu (no, this is not a type-o.  Do it a second time).
  • You will now be at the class.

This works even if the method is in the .NET library and you don’t have the code for it.  It will simply bring up as much of the class definition as it can reflect.  That is, you’ll see the class name, methods, and properties, but you won’t see the code that actually makes it all work.

 

Other post in Did you know
  • Did you know - Zip is built into .NET? - August 21st, 2008
  • Panel DefaultButton does not work - September 23rd, 2008
  • Automatic Implementation of Interfaces - October 1st, 2008
  • Easily Find Classes, Methods, and Variables - November 17th, 2008
  • Advantages of Using Class Diagram - November 20th, 2008
  • Renaming Properties, Methods and Variables - November 25th, 2008
  • Finding a CSS Class Definition - December 3rd, 2008

If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!

Related Post

  • Finding a CSS Class Definition
  • Renaming Properties, Methods and Variables
  • Readonly variables in CSharp? Really?!
Bookmark to:

Add to Del.icio.us Add to digg Add to DotNetKicks Add to DZone Add to Facebook Add to Slashdot Add to Stumble Upon Add to Technorati
Hide Sites
Tags: class, definition, function, method, variables

Comments are closed.

← Professional ASP.NET 3.5: In C# and VB
SystemException: The trust relationship between the primary domain and the trusted domain failed →
  • Search

  • Subscribe

    U COMMENT
    I FOLLOW

    Subscribe in a reader

    OR

    Subscribe via e-mail

    Enter your email address: 

    Delivered by FeedBurner

     

  • Follow Me

    • Twitter
    • FaceBook
    • Digg
    • StumbleUpon
    • Propeller
    • Delicious
    • Plaxo

     

  • Recent Posts

    • ASUS Eee PC 1005HA-PU1X-BK Black Netbook
    • jQuery – Date Picker
    • Using VB.NET From CSharp
    • iTextSharp – Adding Images
    • Hungarian Notation – Use What Works, Spit Out The Bones
    • Pre Order Windows 7
    • jQuery Dialog – With Validation Controls
    • iTextSharp – The easy way
    • Structure of my ASP.NET Web Applications
    • 35% Off Accronis True Image 2009 Home
    • VB.NET Hide Module Name
    • ASP.NET/VB.NET – Video Training
    • Does jQuery Make Us Lazy?
    • PDFs Using iTextSharp
    • Programming SEO – Ping



  • Advertise on this site through Lake Quincy Media
  • DotNetNuke Sponsor

     

    Most Valuable Blogger
  • Sponsor

  • Categories

    • Advanced CSharp
    • Advanced VB.NET
    • ASP.NET MVC
    • Did you know
    • DotNetNuke – Module Development
    • DotNetNuke – Skinning
    • internationalization
    • iTextSharp
    • jQuery
    • none
    • Seach Engine Optimization
    • Silverlight
    • SQL For Programmers
    • Twitter
    • winforms
  • Cloud

    .net ajax architecture asp.net book books containers csharp css dal dataset datasets dotnetnuke events gridview images internationalization internet explorer javascript jQuery json linq listview modules ms-sql MVC objectdatasource programming reflection seo Silverlight skinning sql testing tsql tutorial Twitter twitterizer vb.net video view Vista visual studio webservice WordPress
  • Archives

    • July 2009
    • June 2009
    • May 2009
    • April 2009
    • March 2009
    • February 2009
    • January 2009
    • December 2008
    • November 2008
    • October 2008
    • September 2008
    • August 2008
    • July 2008
    • June 2008
    • May 2008
    • April 2008
    • March 2008
    • February 2008
    • January 2008
    • December 2007
    • November 2007
    • October 2007
  • Meta

    • Log in
    • Entries RSS
    • Comments RSS
    • WordPress.org
    • Privacy Policy
  • Calendar

    November 2008
    S M T W T F S
    « Oct   Dec »
     1
    2345678
    9101112131415
    16171819202122
    23242526272829
    30  
  • Blogroll

    • Alvin Ashcraft’s Morning Dew
    • ASP.NET Consulting
    • Life Hacker
    • Remember Anything
    • The Price of Their Toys
    • Uncategorized Thought


.NET Answers © 2007 - 2008 All Rights Reserved.
Entries and Comments.