Panel Control Question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am stuck on something that must be simple. However, I have been searching the obvious places for several days but haven't come up with an answer:

I have a Panel control with a custom designer. The designer creates several designer verbs. When a verb is selected, I want to instantiate a new Panel control on the 'base' Panel control, and allow the designer to edit the new Panel control (i.e., add other controls). The designer verbs work fine. However, if I simply use .Add to add a new Panel to the 'base' Panel the newly added Panel shows up on the UserControl but cannot be edited. On the other hand, if I simply drag a Panel control from the Toolbox to the 'base' Panel I can edit it--which is the behavior I want.

The correct way to accomplish so it works this would be much appreciated!
 
Use the GetService method to get the IDesignerHost, then use the
CreateComponent method.

Duncan S. said:
I am stuck on something that must be simple. However, I have been
searching the obvious places for several days but haven't come up with an
answer:
I have a Panel control with a custom designer. The designer creates
several designer verbs. When a verb is selected, I want to instantiate a new
Panel control on the 'base' Panel control, and allow the designer to edit
the new Panel control (i.e., add other controls). The designer verbs work
fine. However, if I simply use .Add to add a new Panel to the 'base' Panel
the newly added Panel shows up on the UserControl but cannot be edited. On
the other hand, if I simply drag a Panel control from the Toolbox to the
'base' Panel I can edit it--which is the behavior I want.
 
Sorry to be dense, Andrew, but when I took a look at the GetService method IDesignerHost was not one of the options. Could you be a bit more specific? Thanks!
 
Back
Top