Make Floating Window Resizeable

12 posts, 1 answers
  1. Steve
    Steve avatar
    11 posts
    Member since:
    Jun 2013

    Posted 08 May Link to this post

    I'm using RadDock 2017.2.502.40.

    When I drag a toolwindow, that is initially docked, it becomes a floating window.  I am unable to resize the floating window.

    Unfortunately, it seems, that by default the floating window cannot be resized.  I've created a fresh form with a RadDock so this behavior is right out of the box.

    I've handled the FloatingWindowCreated event and set the FormBorderStyle per this post: 

    http://docs.telerik.com/devtools/winforms/dock/object-model/customizing-floating-windows

    But it seems to have no effect.  The floating window still cannot be resized.  I know the code is running because I've put in breakpoints.  The FormBorderStyle does change.

    Just to make sure that something works, I've tried e.Window.Controls.Clear() and all the controls are gone when the floating window displays.  But it's not resizeable.

    How do I make a floating tool window resizeable.

     

    Thanks,

    Steve

     

  2. Steve
    Steve avatar
    11 posts
    Member since:
    Jun 2013

    Posted 08 May in reply to Steve Link to this post

    It appears that settings are getting applied to the Floating Window only AFTER the FloatingWindowCreated event:

    In the designer I've specified the DefaultFloatingSize to be 700x700.  See image.

    But when I put a break point in the handler for the FloatingWindowCreated event and check the size of the window it is the default 300x300 still.

    Yet...when the Floating Window finally opens it is 700x700.

    What does this mean?  It seems to me that the DefaultFloatingSize is being applied AFTER the FloatingWindowCreated event.  Are all the other default settings being applied AFTER that event as well?

    Whatever properties I try to set in the FloatingWindowCreated event, it seems they are overwritten after that.

  3. Dimitar
    Admin
    Dimitar avatar
    1871 posts

    Posted 10 May Link to this post

    Hello Steve,

    This is an issue which was introduced in the latest version of the suite (works in previous versions). I have logged the issue in our Feedback Portal. I have added a vote for it on your behalf as well. You can track its progress, subscribe for status changes and add your comment to it here. I have also updated your Telerik Points.

    To workaround this you can create a custom floating window:
    class MyWindow : FloatingWindow
    {
        public MyWindow(RadDock dock): base(dock)
        {
     
        }
        protected override CreateParams CreateParams
        {
            get
            {
                CreateParams cp = base.CreateParams;
                cp.Style &= NativeMethods.WS_THICKFRAME;
                return cp;
            }
        }
    }

    The FloatingWindowCreated event allows you to change the window:
    private void RadDock1_FloatingWindowCreated(object sender, Telerik.WinControls.UI.Docking.FloatingWindowEventArgs e)
    {
        e.Window = new MyWindow(radDock1);
        e.Window.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Sizable;
     
    }

    Should you have any other questions do not hesitate to ask.

    Regards,
    Dimitar
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  4. Steve
    Steve avatar
    11 posts
    Member since:
    Jun 2013

    Posted 10 May in reply to Dimitar Link to this post

    Thank you.  That fixed the resizing problem, but exposed another one.  I can resize the floating window now, but there are painting issues.  When the floating window is first displayed after being undocked, child controls are not visible.  After something triggers a paint event like moving or resizing, the children are drawn.  However, when the parent form gets focus, the child controls disappear again.

    So, essentially, while the floating window is now resizeable, it's unusable in that mode.

    I suspect this issue is an extension of the last, but if you have another work around that would be great.

  5. Kenneth
    Kenneth avatar
    10 posts
    Member since:
    Jul 2010

    Posted 10 May Link to this post

    This feature was present until the latest release.  Our applications depend on being able to resize floating windows.  This is a MAJOR issue that needs to be address immediately.  I added a comment and voted on the bug.
  6. Kenneth
    Kenneth avatar
    10 posts
    Member since:
    Jul 2010

    Posted 10 May in reply to Kenneth Link to this post

    I should add that the default behavior MUST be resizable, or expose an option in the properties to set it to resizable with a default of resizable.  While the event handler above is a solution, it is less than ideal.  We have 26 applications that use ToolWindows.  Adding the event handler to all of them to get back a feature that was present until the latest release is unacceptable.
  7. Answer
    Dimitar
    Admin
    Dimitar avatar
    1871 posts

    Posted 11 May Link to this post

    Hello,

    The mistake is mine. You should change the following line:
    cp.Style |= NativeMethods.WS_THICKFRAME;


    When this is resolved the behavior will be exactly as it was before and you will not have to change anything in your existing applications.

    Do not hesitate to contact us if you have other questions.

    Regards,
    Dimitar
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  8. Steve
    Steve avatar
    11 posts
    Member since:
    Jun 2013

    Posted 11 May in reply to Dimitar Link to this post

    Thank you.  This workaround has now fixed the issue for me.
  9. Hardy
    Hardy avatar
    14 posts
    Member since:
    Mar 2012

    Posted 24 May in reply to Kenneth Link to this post

    Hi all,

    the same issue will appear using custom controls for docking.

    We also need a fix for that immediately.

  10. Hristo
    Admin
    Hristo avatar
    1028 posts

    Posted 25 May Link to this post

    Hi Hardy,

    Thank you for writing.

    Can you please provide me with more details about your actual setup. Is the workaround applicable in your project? The fastest way to investigate would be to open up a support ticket and attaching your project.

    I hope this helps. Looking forward to your reply.

    Regards,
    Hristo
    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  11. Hardy
    Hardy avatar
    14 posts
    Member since:
    Mar 2012

    Posted 30 May in reply to Hristo Link to this post

    Hi Hristo,

    i have setup a project where you can check the mall function.

    I'm using VS 2017 and Telerik 2017.2.502.40

    Regards,

    Hardy

  12. Dimitar
    Admin
    Dimitar avatar
    1871 posts

    Posted 31 May Link to this post

    Hello Hardy,

    We can continue discussing your case in the support ticket. 

    Regards,
    Dimitar
    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top