Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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.

"Programmers are tools for converting caffeine into code."

 

Madcow Inventions -- Software for the Sanity Challenged.

Posted
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.

"Programmers are tools for converting caffeine into code."

 

Madcow Inventions -- Software for the Sanity Challenged.

Posted

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?

"Programmers are tools for converting caffeine into code."

 

Madcow Inventions -- Software for the Sanity Challenged.

  • *Gurus*
Posted
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.

MVP, Visual Developer - .NET

 

Now you see why evil will always triumph - because good is dumb.

 

My free .NET Windows Forms Controls and Articles

Posted

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.

"Programmers are tools for converting caffeine into code."

 

Madcow Inventions -- Software for the Sanity Challenged.

Posted
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.

"Programmers are tools for converting caffeine into code."

 

Madcow Inventions -- Software for the Sanity Challenged.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...