C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,648 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Dear All,
Could anybody tell me how to subclass a c# control?
TIA
Here are some examples
Then there are components, for instance, there is no BindingNavigator in .NET Core (at least in VS2019) so we can expose it as follows.
using System.Windows.Forms;
namespace WindowsControlLibrary.Classes
{
/// <summary>
/// VS2019 there is no BindingNavigator, here you go :-)
/// </summary>
public class CoreBindingNavigator : BindingNavigator
{
public CoreBindingNavigator()
{
AddStandardItems();
}
}
}
You can do like : How to: Inherit from Existing Windows Forms Controls
(or also SetWindowSubclass with P/Invoke for existing controls, like in C++)