Home Forums WinForms controls Other WinForms controls Sizing the ToolWindow

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #18114 |

    Hi:

    I have a Main Form on which I have docked two tool windows left and right. I was able to that without much pain but the problem is both the tools windows have occupied half of the space on the main form (toolWindowA 50% and toolWindowB 50%). What I want is to resize toolWindowA so that it occupies only 25 % of the total space. I tried changing the size property but that did not work.

    What property do I have to change to resize the toolWindow ?

    thanks in advance.

    Imported from legacy forums. Posted by rxraza (had 2907 views)

    User (Old forums)
    Member
    Post count: 23064

    use this routine to help me handle the size, I do it in the StateChanged event of the toolwindow :

    private void myWindow_StateChanged(object sender, EventArgs e)
    {

    if ( ( (ToolWindow)sender).State == Xceed.DockingWindows.ToolWindowState.AutoHide)

    {

    System.Diagnostics.Debug.WriteLine(“Event Triggered where the State is now now AutoHide”);

    // you can change it to what you need.
    myWindow.FloatingWindowBounds = new System.Drawing.Rectangle(0,0,50,50);

    }

    if ( ( (ToolWindow)sender).State == Xceed.DockingWindows.ToolWindowState.Docked)

    {
    //you can set the value to what you need.
    System.Diagnostics.Debug.WriteLine(“Event Triggered where the State is now docked”);

    myWindow.Width = 30;

    }

    if ( ( (ToolWindow)sender).State == Xceed.DockingWindows.ToolWindowState.Floating)

    {
    System.Diagnostics.Debug.WriteLine(“Event Triggered where the State is now Floating”);
    myWindow.FloatingWindowBounds = new System.Drawing.Rectangle(0,0,50,50);

    }

    {

    Imported from legacy forums. Posted by Matt (had 521 views)

    User (Old forums)
    Member
    Post count: 23064

    Or you can change the width of the toolwindow when it pops out by changing the Bounds of the window.

    if ( ( (ToolWindow)sender).State == Xceed.DockingWindows.ToolWindowState.AutoHide)
    {

    myWindow.Bounds = new System.Drawing.Rectangle(0,0,100,100);

    }

    Peter Henry
    IT Revolution
    Senior Programmer

    Imported from legacy forums. Posted by Peter (had 3437 views)

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.