Windows Develop Bookmark and Share   
 index > Windows Forms Designer > How can i add a verb to a components designer from a different components designer
 

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

carlsonad  Wednesday, September 20, 2006 10:18 PM
do you encounter any duplicaes when another FlowLayoutPanel instance is created by this routine?
joeycalisay  Thursday, September 21, 2006 10:35 AM

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 ainstance of adesigner is in charge of "designing" one instance of a component. So unlessthe verbs collection was some how shared between designer instancesi wouldn't see duplicates with this code.

carlsonad  Thursday, September 21, 2006 2:26 PM
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...
joeycalisay  Friday, September 22, 2006 1:25 AM

You can use google to search for other answers

Custom Search

More Threads

• Can someone help a newbie please (Unicode text documents in VB.Net)
• Custom combobox behavior
• Editing (specifically deleting) from hosted designers
• more than one value in listbox
• How to customize the selection border of selected control in VS2005 (WinForm)
• Delete or Reset User ApplicationSettings
• control Event
• form designer compile error between 2003 & 2005
• How to resize the window form control dynamically
• Move non-container user control