- Back to Home »
- Windows Applications »
- Windows Forms User Controls
Posted by :
Sudhir Chekuri
Monday, 22 February 2016
User Controls are controls that are created by the users with customized requirements. We can create a new control with so that we can reuse it in our project.
Implementing User Controls
Select project template as Windows Form control Library
Click on OK
Drag and drop exiting controls in toolbox and edit it based on your requirements
Build the project to get the dll for usercontrol in project location
Example: Projects\MyUserControl\MyUserControl\bin\Debug
Goto toolbox and create a new tab with a right click on exiting tab of toolbox and select Add new tab
Edit the caption of tab
Right click on the new tab and click on choose items
Select the browse button and select the user control dll
New control will be added to the toolbox which can be used everywhere in the project by simple drag and drop option to the design of the form.
Implementing User Controls
Steps to create user control
File – New Project – Select language as C#Select project template as Windows Form control Library
Click on OK
Drag and drop exiting controls in toolbox and edit it based on your requirements
Build the project to get the dll for usercontrol in project location
Example: Projects\MyUserControl\MyUserControl\bin\Debug
Using User Controls
Create a new windows applicationGoto toolbox and create a new tab with a right click on exiting tab of toolbox and select Add new tab
Edit the caption of tab
Right click on the new tab and click on choose items
Select the browse button and select the user control dll
New control will be added to the toolbox which can be used everywhere in the project by simple drag and drop option to the design of the form.