GuidoG GuidoG - 1 month ago 19
C# Question

Where is the source code for the .Net Framework controls?

What I like about Delphi is that the code for all controls and components is available.
Its all in what is called the VCL (Visual Component Library)
This proved to be very usefull when designing custom controls and components.
AFter all, each control and component in Delphi was written in Delphi, so it makes sense to include that code with Delphi so we can look in it and even debug it.

So I am wondering if this is also the case with C# ?
I suspect that controls like for example TextBox is written in C# so is it possible to take a look at that code like it is in Delphi ?

Answer

The vast majority of the source to the .NET Framework (including the controls) can be found at:

http://referencesource.microsoft.com/

Specifically, the TextBox class for WinForms can be found here: http://referencesource.microsoft.com/#System.Windows.Forms/winforms/Managed/System/WinForms/TextBox.cs,577a143ad3bbfb97

You can download the source from referencesource.microsoft.com/download.html