By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,459 Members | 1,472 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,459 IT Pros & Developers. It's quick & easy.

Visually Editing Panels and DesignerAttributes

P: n/a
I've just started working with some people that have an odd setup and
I'm wondering if someone can point out a better way of doing things (or
what I'm doing wrong).

They have a base form class, derived from the standard Form, but with
the ability to show a list of panels in order.

Each of these panels is a subclass of a subclass of Panel. The initial
subclass is tweaked to work with the special form and then each
subclass of that is what will actually be displayed on the special
form.

This all works fine, but because there is no visual editor for panels
in VS.NET they've taken to going into the panel code, changing the
superclass from PanelSpecial to Form, editing the form visually and
then changing the superclass back to PanelSpecial again.

I'm fairly new to C#, but some digging around made me think that
putting this attribute into the PanelSpecial class would mean that the
subclasses could be edited as if they were forms (without all that
tedious setting/resetting of the superclass).

[Designer("System.Windows.Forms.Design.DocumentDesi gner,
System.Windows.Forms.Design.DLL",
typeof(IRootDesigner)),
DesignerCategory("Form")]

However this doesn't work at all (I get an "unable to find a designer"
error), although by playing around with it I've been able to make it
display the component editing designer but this isn't actually very
useful.

Can anyone suggest either a way to make the visual editing of panels
work ok, or an alternative architecture which would allow GUI editing?

Thanks,

Andy D

Nov 16 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
They should create a subclass of UserControl, place a Panel on it, and then
add their special code from there. You can graphically design UserControls.

JIM
"AndrewDucker" <an****@ducker.org.uk> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
I've just started working with some people that have an odd setup and
I'm wondering if someone can point out a better way of doing things (or
what I'm doing wrong).

They have a base form class, derived from the standard Form, but with
the ability to show a list of panels in order.

Each of these panels is a subclass of a subclass of Panel. The initial
subclass is tweaked to work with the special form and then each
subclass of that is what will actually be displayed on the special
form.

This all works fine, but because there is no visual editor for panels
in VS.NET they've taken to going into the panel code, changing the
superclass from PanelSpecial to Form, editing the form visually and
then changing the superclass back to PanelSpecial again.

I'm fairly new to C#, but some digging around made me think that
putting this attribute into the PanelSpecial class would mean that the
subclasses could be edited as if they were forms (without all that
tedious setting/resetting of the superclass).

[Designer("System.Windows.Forms.Design.DocumentDesi gner,
System.Windows.Forms.Design.DLL",
typeof(IRootDesigner)),
DesignerCategory("Form")]

However this doesn't work at all (I get an "unable to find a designer"
error), although by playing around with it I've been able to make it
display the component editing designer but this isn't actually very
useful.

Can anyone suggest either a way to make the visual editing of panels
work ok, or an alternative architecture which would allow GUI editing?

Thanks,

Andy D

Nov 16 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.