简体   繁体   English

如何同时使用停靠窗口和非停靠窗口

[英]how to use dock window & non-dock together

I need some part of UI to behave like dock window, but not all. 我需要UI的某些部分表现像停靠窗口,但不是全部。 I wonder if that's possible to mix the two. 我想知道是否可以将两者混为一谈。 Say, I want 3 datagrids to be fixed in their positions, but I want settings windows to dock on right side or in middle of main window, when mouse hovers on it, it will expand and show all settings, when mouse moves away, the setting window simply collapses. 说,我想将3个数据网格固定在它们的位置,但是我想将设置窗口停靠在主窗口的右侧或中间,当鼠标悬停在其上时,它将展开并显示所有设置,当鼠标移开时,设置窗口完全崩溃。 but I do not want the other 3 data grids to move or collapse. 但我不希望其他3个数据网格移动或折叠。 I'd like the data grid show up as normal, not like a dock document. 我希望数据网格正常显示,而不像停靠文档那样。
Thanks 谢谢

Edit 编辑

My project uses both WPF and WinForms. 我的项目同时使用WPF和WinForms。 So I am looking for solutions for both 所以我正在寻找两种解决方案

Just dock the settings to the right and listen to the MouseEnter and MouseLeave events. 只需将设置停靠在右侧,并监听MouseEnter和MouseLeave事件。 Change the width of the settings to zero, or something very small, when MouseLeave, and back to full width on MouseEnter. 当MouseLeave时,将设置的宽度更改为零或很小,然后在MouseEnter上恢复为全宽。

Resizing a docked control behaves very nicely. 调整停靠控件的大小非常好。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM