![]() |
How to add inherited control to toolbox.
Hi all.
I created a custom control by inheriting the trackbar control. It works fine but I've to write code every time I need to add that control to a form. I want that the users of the control should be able to drag and drop the control from the toolbox (like all the other controls) but the control isn't showing in the toolbox. Any Ideas how to go about that? |
Assuming you started your project as a Windows Control Library:
Open a new instance of the VS .NET. Create a new project choosing the Windows Application template. From a new Windows Forms project, we can add the compiled custom control to the toolbox. I do this by right-clicking the toolbox, selecting Customize Toolbox, and from the .NET Framework Components tab, clicking Browse and locating the Control Library DLL. The component will then appear in the Toolbox. |
I think you didn't understand what I meant.
If I create a UserControl, I can edit the appearance and put other controls on it at design time. But I wanted to directly inherit from TrackBar and by not putting the TrackBar on UserControl. I simply created a class file having code something like: :
public class myTrackbar: TrackbarIf I create a UserControl, then after compilation, the control is automatically added to the toolbox. But for inherited control I have to write code like: :
private myTrackBar tb1;??:confused: |
Solved!
I figured out that I needed to create a myTrackbar.Designer.cs file.
|
| All times are GMT -5. The time now is 2:01 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC