How can i add a verb to a components designer from a different components designer

I need to add a designer verb to a components designer from a different components designer.

This is what i am currently doing to add the verb and i am wondering if this would be the recomended way to do it.

FlowLayoutPanel flp = this.DesignerHost.CreateComponent( typeof( FlowLayoutPanel ) ) as FlowLayoutPanel;

flp.Dock = DockStyle.Fill;

RootTableLayoutPanel.Controls.Add( flp );

RootTableLayoutPanel.SetCellPosition( flp, new TableLayoutPanelCellPosition( column, row ) );

this.DesignerHost.GetDesigner( flp ).Verbs.Add( this.mergeCellsVerb );

Thanks




Answer this question

How can i add a verb to a components designer from a different components designer

  • borice

    do you encounter any duplicaes when another FlowLayoutPanel instance is created by this routine


  • delas

    Do you mean dublicate verbs

    I do not see duplicate verbs with this logic when it creates multiple instances of the FlowLayoutPanel.

    My understanding is that a instance of a designer is in charge of "designing" one instance of a component. So unless the verbs collection was some how shared between designer instances i wouldn't see duplicates with this code.



  • Scottie S

    my previous notion of designer is one designer to many components (of same type). i might be wrong so i got to check it out again...


  • How can i add a verb to a components designer from a different components designer