• Hello and welcome to our new forums. We upgraded our forum sites to a more robust and modern system which we hope you will enjoy. Be sure to check out your profile by clicking the button on the top right and configure your preferences, signature, time zone, avatar, etc. as you wish. If you need help with using this new forum'ware try the help link on the bottom right.

    Click here to review your account now.

FYI Develop your custom controls

jpesant

New member
Joined
Apr 24, 2019
Messages
3
Programming Experience
5-10
You can easily build your controls or extend control like textbox by adding properties, methods or changing the render of it. The best way to understand how to do that is by exploring my custom controls on this github project:

If you like challenge or contribute, don't hesitate to participate on this project. It's the best way to expend your knowledge on custom controls.
 

jpesant

New member
Joined
Apr 24, 2019
Messages
3
Programming Experience
5-10
In this case, it's a library named wetcontrols but each controls aren't name with this namespace. They are the prefix 'Wet' because it's an extension of the .net controls. WetTextbox extends Textbox but it's the same thing when you call a control TextboxExt.
 

JohnH

C# Forum Moderator
Staff member
Joined
Apr 23, 2011
Messages
498
Location
Norway
Programming Experience
10+
Names of Classes, Structs, and Interfaces | Microsoft Docs
Names of Namespaces | Microsoft Docs
✓ CONSIDER ending the name of derived classes with the name of the base class.

This is very readable and explains the relationship clearly. Some examples of this in code are: ArgumentOutOfRangeException, which is a kind of Exception, and SerializableAttribute, which is a kind of Attribute. However, it is important to use reasonable judgment in applying this guideline; for example, the Button class is a kind of Control event, although Control doesn’t appear in its name.
I wouldn't consider a branding or technology prefix to be reasonable in naming a class. As Skydiver said, that belongs in a namespace. What if Microsoft had put a "Net" prefix on all classes in .Net Framework?
The name should indicate functionality, there's nothing wrong in calling your flavour of TextBox just "TextBox" if there is not a special purpose that you can explain in the name.
 

Skydiver

Well-known member
Joined
Apr 6, 2019
Messages
50
Location
Virginia Beach, VA
Programming Experience
10+
On a closer look at the source code for the various WetWidgetXs in that GitHub link above, it looks like it is still using WebForms to render controls, instead of the modern Razor approach. It feels like modern .NET Core is regressing back to old fashioned WebForms. Is the primary goal of this library to help people port their old WebForms code? Or does it have a different goal? I can't seem to find the reason for being in the README.md.
 

jpesant

New member
Joined
Apr 24, 2019
Messages
3
Programming Experience
5-10
I think I will develop both approach, WebForms (not WinForms) and Razor for MVC.
 
Top Bottom