Home Forums WinForms controls Other WinForms controls DockLayoutManager and Toolbar Reply To: DockLayoutManager and Toolbar

User (Old forums)
Member
Post count: 23064

What do you mean by the gray area?  Can you provide a screenshot or more details? 

Here is a code sample showing what is needed for this to work.  Note however that this can all be done in the designer.

private void Form1_Load( object sender, EventArgs e )

{

    Panel panel1 = new Panel();

    this.Controls.Add( panel1 );

    panel1.Dock =

DockStyle.Fill;

 

    Panel panel2 = new Panel();

    panel1.Controls.Add( panel2 );

 

    MenuStrip menu = new MenuStrip();

    menu.Items.Add( “Menu Item” );

    this.Controls.Add( menu );

 

    ToolWindow tool = new ToolWindow( “ButtonTool” );

    tool.Text = “Buttons”;

    Button but = new Button();

    but.Text = “button”;

    tool.Controls.Add( but );

 

    DockLayoutManager manager = new DockLayoutManager( panel1, panel2 );

    manager.ToolWindows.Add( tool );

    tool.DockTo( DockTargetHost.DockHost, DockPosition.Top );

 

Imported from legacy forums. Posted by André (had 5496 views)