ControlDesigner for TabControl

  • Thread starter Thread starter Rachel Suddeth
  • Start date Start date
R

Rachel Suddeth

I would like to write a designer verb for a class I have that inherits from
TabControl. I figure the only way to do that without breaking the special
designer stuff that works for TabControl would be to inherit from whatever
Designer class is currently used for the TabControl. But I can't find out
what that is. There must be one... I would hope it wouldn't be sealed...
anyone know what it's called or how to get information about it? Or know of
another way to go about this?

-Rachel
 
First, quickly go to http://www.aisto.com/roeder/dotnet/ and download
the greatest .Net utility ever, Lutz Roeder's Reflector.

Then run it, and navagate to "System.Windows.Forms.TabControl".
Right-click and choose "Disassembler". Read the information you desire
("System.Windows.Forms.Design.TabControlDesigner, System.Design,
Version=1.0.5000.0") from the new panel.
--
--
Truth,
James Curran
[erstwhile VC++ MVP]

Home: www.noveltheory.com Work: www.njtheater.com
Blog: www.honestillusion.com Day Job: www.partsearch.com
 
Ugh. It's not sealed, but has "internal" visibility, so I don't think I can
inherit from it.

James Curran said:
First, quickly go to http://www.aisto.com/roeder/dotnet/ and download
the greatest .Net utility ever, Lutz Roeder's Reflector.

Then run it, and navagate to "System.Windows.Forms.TabControl".
Right-click and choose "Disassembler". Read the information you desire
("System.Windows.Forms.Design.TabControlDesigner, System.Design,
Version=1.0.5000.0") from the new panel.
--
--
Truth,
James Curran
[erstwhile VC++ MVP]

Home: www.noveltheory.com Work: www.njtheater.com
Blog: www.honestillusion.com Day Job: www.partsearch.com

Rachel Suddeth said:
I would like to write a designer verb for a class I have that inherits from
TabControl. I figure the only way to do that without breaking the special
designer stuff that works for TabControl would be to inherit from whatever
Designer class is currently used for the TabControl. But I can't find out
what that is. There must be one... I would hope it wouldn't be sealed...
anyone know what it's called or how to get information about it? Or know of
another way to go about this?

-Rachel
 
Bless you, Mick, this is perfect. I was looking at doing something like this
(inheriting from ParentControlDesigner) but was afraid my boss would think
it was too big a job & wouldn't let me (could've done enough to get by with
standard TabPages plus an ExtenderProvider or two, but that would've been
awkward.) But with sample code, it's a no-brainer to do it the right way :-)

And you give me code to copy for the cancelable SelectedIndexChanging event
that we were going to have to write anyway (can't think why that wasn't
supplied in the first place - seems like an obvious need.) I could just kiss
you!
(shhh, don't tell my husband i said that)

-Rachel


"Mick Doherty"
 
That's the advantage of being a hobby programmer, you can waste as much time
as you like on seemingly trivial things like this which, until you try it,
you would expect to be simple.

In a few months time, if you upgrade to VS2005, you'll have the
SelectedIndexChanging event as standard as well as themed tabpages.

I'm waiting for Beta2 to arrive to see if the IDE behaves any better with
this custom Designer. In Beta1 you can't drag controls into position (but
you can size them into position) and when you add a control to a tabpage,
the selection changes to the last tabpage. I'm hoping that this is just a
bug with Beta1 since there has been a lot of work done on Designers for
VS2005.
 
Back
Top