Author Topic: Sublclassing ControlCollection  (Read 1336 times)

0 Members and 1 Guest are viewing this topic.

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Sublclassing ControlCollection
« on: April 17, 2020, 09:36:01 AM »
I am attempting to build a control that I have needed for a very long time because I have not been able to find something suitable.
I am trying to create a flyout button (yeah, I thought there would be one) that can be expanded horizontally or vertically.
I've got a rudimentary version working, but I want to limit the ability to add controls to three specific types that are subclassed button, label and separator.
For now, everything else needs to be filtered out, but I can't filter them if I can't override the add method of ControlCollection .. and when I attempt to subclass ControlCollection I get an error that ControlCollection does not contain a constructor that takes 0 arguments ..

I've tried with default constructors zero arguments and every argument value in between. No dice.

Should I just give up this idea?
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Re: Sublclassing ControlCollection
« Reply #1 on: April 17, 2020, 10:34:31 AM »
Ok, it seems I just answered my own question … just capture the ControlAdded event on the usercontrol and dispose of it if it isn't what I need.
inefficient, but effective.
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie