问题描述
是否有一种方法可以仅在 Resize End 中调整Winform
窗口的大小?
Is there a way to resize a Winform
window just in Resize End?
这意味着只要单击鼠标,我就会看到线条,并且只有当我离开鼠标(调整大小"端)窗口时,才会在屏幕上调整大小.
This means that as long as the mouse is clicked I see lines and only when I leave the mouse (Resize end) window will resize on the screen.
推荐答案
您将需要使用 DrawReversibleFrame .默认大小调整将需要被禁用(FormBorderStyle = FixedSingle).
You will need to use DrawReversibleFrame. Default resizing will need to be disabled (FormBorderStyle = FixedSingle).
基本逻辑是-
MouseDown
-开始跟踪MouseMove
-绘制可逆框架MouseUp
-停止绘制可逆框架.调整表格大小.
MouseDown
- Begin tracking MouseMove
- Draw Reversible FrameMouseUp
- Stop Drawing Reversible Frame. Resize Form.
幸运的是,此MSDN 帖子调整表单大小时才有此功能的工作代码.我已经为您制作了一个工作样本. http://www.mediafire.com/download/427g2h2ajm5z62m/ResizeFrame.zip
Luckily this MSDN post had working code for this. I have a made a working sample for you.http://www.mediafire.com/download/427g2h2ajm5z62m/ResizeFrame.zip
您将需要对此进行调整,以便仅当用户'MouseDown'在边框附近时才会发生表单调整大小.
You will need to tweak this so Form resize only happens when user 'MouseDown' near the border.
这篇关于仅在调整大小结束时才调整winform窗口的大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!