This is a migrated thread and some comments may be shown as answers.

Make Floating Window Resizeable

11 Answers 203 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Steve
Top achievements
Rank 1
Steve asked on 08 May 2017, 03:18 PM

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

 

11 Answers, 1 is accepted

Sort by
0
Steve
Top achievements
Rank 1
answered on 08 May 2017, 04:57 PM

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.

0
Dimitar
Telerik team
answered on 10 May 2017, 06:58 AM
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.
0
Steve
Top achievements
Rank 1
answered on 10 May 2017, 03:22 PM

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.

0
Kenneth
Top achievements
Rank 1
answered on 10 May 2017, 05:01 PM
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.
0
Kenneth
Top achievements
Rank 1
answered on 10 May 2017, 05:04 PM
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.
0
Accepted
Dimitar
Telerik team
answered on 11 May 2017, 08:26 AM
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.
0
Steve
Top achievements
Rank 1
answered on 11 May 2017, 01:18 PM
Thank you.  This workaround has now fixed the issue for me.
0
Hardy
Top achievements
Rank 1
answered on 24 May 2017, 06:55 PM

Hi all,

the same issue will appear using custom controls for docking.

We also need a fix for that immediately.

0
Hristo
Telerik team
answered on 25 May 2017, 03:34 PM
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.
0
Hardy
Top achievements
Rank 1
answered on 30 May 2017, 02:50 PM

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

0
Dimitar
Telerik team
answered on 31 May 2017, 05:14 AM
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.
Tags
Dock
Asked by
Steve
Top achievements
Rank 1
Answers by
Steve
Top achievements
Rank 1
Dimitar
Telerik team
Kenneth
Top achievements
Rank 1
Hardy
Top achievements
Rank 1
Hristo
Telerik team
Share this question
or