mooman_fl Posted March 19, 2003 Posted March 19, 2003 Right now I am working on a DLL that consist of several UserControls. At the moment they all show in the toolbox at design time. One of the controls however I want to be internal only. (ie... only usuable from within another control and not sepearately.) To clarify this... I have a control (ToolScroll) that will be able to add the second control (ToolPanel) to itself dynamically at design time (via designer) or runtime (via exposed methods). However I don't want the Toolpanel available in the Toolbox. I only want this control to be availble second-hand through the Toolscroll control. Anyideas? I tried just declaring the ToolPanel class as Private but was told that this could only be declared inside another type. Quote "Programmers are tools for converting caffeine into code." Madcow Inventions -- Software for the Sanity Challenged.
*Gurus* divil Posted March 20, 2003 *Gurus* Posted March 20, 2003 Declare it as Friend (vb) or internal (c#). Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
mooman_fl Posted March 20, 2003 Author Posted March 20, 2003 Already tried that approach since that worked to keep other classes I had from showing up for the end user. While it keeps the control from being used on a form... it still shows up in the toolbox. Quote "Programmers are tools for converting caffeine into code." Madcow Inventions -- Software for the Sanity Challenged.
*Gurus* divil Posted March 20, 2003 *Gurus* Posted March 20, 2003 Apply a ToolboxItem(False) attribute to it. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
mooman_fl Posted March 20, 2003 Author Posted March 20, 2003 All the sources that I have looked up on this show the ToolBoxItem(false) implemented like this: <ToolboxItem(False)> _ Public Class ToolPanel However when I do this it still shows up in my toolbox... I have saved, rebuilt, and even closed down the IDE and reopened it. Below is my actual code: Imports System.Windows.Forms.Design Imports System.ComponentModel <ToolboxItem(False)> Friend Class ToolPanel Any idea what I am missing or what I should be looking at? Quote "Programmers are tools for converting caffeine into code." Madcow Inventions -- Software for the Sanity Challenged.
mooman_fl Posted March 20, 2003 Author Posted March 20, 2003 BTW.... I did try it with the Class set to Public like the example I showed you... either way it didn't work. Quote "Programmers are tools for converting caffeine into code." Madcow Inventions -- Software for the Sanity Challenged.
*Gurus* divil Posted March 20, 2003 *Gurus* Posted March 20, 2003 It might only be showing up because you're in the project that contains the usercontrol. Have you tried compiling your control library and adding the compiled class to the toolbox from another app? That ToolboxItem(False) has worked for me before. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
mooman_fl Posted March 20, 2003 Author Posted March 20, 2003 Well that seemed to do it. It just gets confusing when all other changes you make show up in the IDE on your project but that doesn't. On a side note... what is the best way to add a toolbox icon to your control? I have another control in the same DLL that WILL show in the toolbox. Quote "Programmers are tools for converting caffeine into code." Madcow Inventions -- Software for the Sanity Challenged.
*Gurus* divil Posted March 20, 2003 *Gurus* Posted March 20, 2003 You need to use the ToolboxBitmapAttribute class. Here's a section of the Windows Forms FAQ that gives you a couple of scenarios: http://www.syncfusion.com/FAQ/WinForms/FAQ_c41c.asp?print=607 Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
mooman_fl Posted March 20, 2003 Author Posted March 20, 2003 Thanks alot divil... that did it. Well now to finish up my control. It will be a free .NET control to mimic the scroller control and collapsable groupboxes used in 3D Studio Max. I will release it and post a link in a day or so when it is done. Quote "Programmers are tools for converting caffeine into code." Madcow Inventions -- Software for the Sanity Challenged.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.