Selectively show custom controls on the toolbox bar in VS2005
-
Hello everyone, I recently started developing a little set of custom controls for a customer of mine. I first began developing one control, then adding the second according to subsequent requests.. and so on. All these controls I deliver in a single, well-packaged DLL file. All of these controls inherits the standard Control Class. But now, since there are many properties shared amongst those controls, I thought that it would have been tidier and clearer to write a class inheriting Control (let us call it MyPowerfulControl), containing all the properties that are used in all of the other custom controls, and then make my other controls inherit from MyPowerfulControl. Nothing seemed to go wrong so far. But now there's a little issue that's bugging me: when I add my custom controls to the toolbox sidebar in Visual Studio, also MyPowerfulControl is shown (and, I kinda not want this). I know that it's possible, when choosing which controls are to be loaded, to un-check the unwanted control. But this is an annoying task for me and my customers... Isn't there a way to tell MyPowerfulControl never to show up, even in the "Choose Control" dialog?
~~~ From Milano to The Hague, easy as it goes ~~~
-
Hello everyone, I recently started developing a little set of custom controls for a customer of mine. I first began developing one control, then adding the second according to subsequent requests.. and so on. All these controls I deliver in a single, well-packaged DLL file. All of these controls inherits the standard Control Class. But now, since there are many properties shared amongst those controls, I thought that it would have been tidier and clearer to write a class inheriting Control (let us call it MyPowerfulControl), containing all the properties that are used in all of the other custom controls, and then make my other controls inherit from MyPowerfulControl. Nothing seemed to go wrong so far. But now there's a little issue that's bugging me: when I add my custom controls to the toolbox sidebar in Visual Studio, also MyPowerfulControl is shown (and, I kinda not want this). I know that it's possible, when choosing which controls are to be loaded, to un-check the unwanted control. But this is an annoying task for me and my customers... Isn't there a way to tell MyPowerfulControl never to show up, even in the "Choose Control" dialog?
~~~ From Milano to The Hague, easy as it goes ~~~
Well, I found a way out - I don't know if it's good programming practice, but it works. I simply declared MyPowerfulControl as an abstract class, and it automagically disappeared from my toolbox. Should this be a Coding Horror, please let me know ;)
~~~ From Milano to The Hague, easy as it goes ~~~