how can i see source code of built in controls in visual studio offline?
http://referencesource.microsoft.com/netframework.aspx
Note that this is shared-source, not open-source. (You can't contribute code)
You can disassemble the IL into somewhat readable source code using Lutz Roeder's Reflector. The local variable names won't be very descriptive, but you can get a good feel for what the program logic is.
You can also disassemble IL using the ILDASM utility, but this is a bit more involved.
In addition to what Schabse Laks writes on downloading the sources at http://referencesource.microsoft.com/netframework.aspx:
There is more info on the sourcecode at http://referencesource.microsoft.com/
You can also configure the .NET debuggers to use http://referencesource.microsoft.com/symbols as a symbol server and step through the .NET 4.0 source code:
- Steps for Visual Studio by Scott Hanselman
- A small fix for the order of debug symbols in Visual Studio 2010 by Sorporbear
- Steps for WinDbg by Naveen Srinivasan
Note that downloading the sources in your debugger can be really slow the first time (lots of sources need to be downloaded, the server might be a bit busy, or your internet connection might be slow).
--jeroen