Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use dockpanelsuite's border in float windows #678

Closed
krulci opened this issue Apr 10, 2022 · 4 comments
Closed

Use dockpanelsuite's border in float windows #678

krulci opened this issue Apr 10, 2022 · 4 comments
Labels

Comments

@krulci
Copy link

krulci commented Apr 10, 2022

https://docs.dockpanelsuite.com/tutorials/customizing-floatwindow.html
The above post explained on how to customize float window to have maximize buttom on the title bar.
Is their any posibility to hide the winforms defaul title bar and use dockpanelsuite's caption bar instead in float windows
I can simply hide the default title bar by setting FormBorderStyle = FormBorderStyle.None;
However, the windows become undraggable and I can't find how to set dockpanelsuite's caption bar to show

@lextm lextm added the question label Apr 10, 2022
@krulci
Copy link
Author

krulci commented Apr 11, 2022

Modifiying the dll HASCaption() does allow the caption bar to appear when nested panel is less than or equal to 1
However, simply setting FormBorderStyle = FormBorderStyle.None; leads to an unwanted excess white area at the right and bottom of the form.

@krulci
Copy link
Author

krulci commented Apr 11, 2022

M@16Y8QG2O$M94WMNETMB

So the CustomeFloatWindow method as described in the documentation seems to only apply FormBorderStyle but does not re-draw the form
Simply setting FormBorderStyle = FormBorderStyle.None; result in unwanted excess white area at the right and bottom of the form.
Which looks like the above image.
In order to have it looks properly, you should modify the dll by doing these two things:
Change DockState == DockState.Float && FloatWindow.VisibleNestedPanes.Count <= 1
to DockState == DockState.Float && FloatWindow.VisibleNestedPanes.Count < 1 in DockPane.cs
Change FormBorderStyle = FormBorderStyle.SizableToolWindow;
to FormBorderStyle = FormBorderStyle.None; in FloatWindow.cs
Compile and replace the WeifenLuo.WinFormsUI.Docking.dll
TF87H)CDH8UJ685J_P_LM{T
Result looks like this.
I am not sure if this is possible to be accomplished through System.Reflection.
Definitely be much more convinient if this is added in the future version of Dock Panel Suite.

@krulci
Copy link
Author

krulci commented Jun 10, 2022

Is it possible to make FormBorderStyle = FormBorderStyle.None sizable?

@lextm lextm closed this as completed Jun 11, 2022
@lextm
Copy link
Member

lextm commented Jun 11, 2022

The mystery around FormBorderStyle.None is a WinForms nightmare for decades, so I don't expect this library be able to help much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants