How to use a class derived from a .NET class such as TableLayoutPanel on a form -


This is a basic question, I'm sure many of you will be able to answer and will not only apply to TableLayoutPanel , But also for all other .NET controls.

I have created a new class which is derived from TableLayoutPanel and I have used this derivation on the form. I want to use instead of the NET version. I am hoping to be able to use drag and drop because all the other controls in one tool box will be.

However, I'm not sure how to do this; I am also guessing that for the divided classes, this drag and drop can not be made in the designer on the form; And should be done only in the code I'm not sure about this and since this is my first one. NET form application, I have no experience coming back. Public class CustomTableLayoutPanel: TableLayoutPanel {}

This control that hosts this control (not directly) implemented in a form called MainForm I think I can go to the deigner.cs (MainForm.Designer.cs) file and change the member variable to a .NET type instead of my custom type, but I'm not sure that it will do this Is the method set to work or is it a hack? . As far as I know, you should not manually change the code and the XXXDesigner.cs file because it is automatically generated.

You have to compile your class at least once, and then it will appear in the toolbox. Then you can drag it by dragging it as any other control.


Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -