![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Professional Programmer
Join Date: Jun 2005
Location: India, The great.
Posts: 435
Rep Power: 4
![]() |
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?
__________________
PFO - My daily dose of technology. |
|
|
|
|
|
#2 |
|
Newbie
Join Date: Feb 2007
Posts: 3
Rep Power: 0
![]() |
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. |
|
|
|
|
|
#3 |
|
Professional Programmer
Join Date: Jun 2005
Location: India, The great.
Posts: 435
Rep Power: 4
![]() |
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: Trackbar
{
...
}If 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; ... tb1 = new TrackBar(); ... this.controls.add(tb1); ... ?? ![]()
__________________
PFO - My daily dose of technology. |
|
|
|
|
|
#4 |
|
Professional Programmer
Join Date: Jun 2005
Location: India, The great.
Posts: 435
Rep Power: 4
![]() |
Solved!
I figured out that I needed to create a myTrackbar.Designer.cs file.
__________________
PFO - My daily dose of technology. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Coding standards without control? | martinig | Other Programming Languages | 1 | Dec 4th, 2006 7:04 AM |
| questions on windows sendMessage and RichEdit control | nomer | C++ | 1 | Mar 3rd, 2006 2:51 AM |
| Multiple sets of radio buttons -- Win32 API | uman | C++ | 11 | Jun 6th, 2005 10:35 PM |
| C programing control of the Serial Port. | Light | C++ | 5 | Feb 24th, 2005 2:14 PM |
| Show web user control hidden | see07 | C# | 1 | Feb 2nd, 2005 10:35 AM |