C#拖放时更改表单大小(C# Change form size on drag and drop)
我想知道是否可以在移动时更改表单的大小?
我想用此完成的是,当用户在两个不同的屏幕之间移动表单时,表单应该改变其大小以适应新的屏幕。
我尝试使用DragDrop操作表单,但没有工作。
请帮忙!
I would like to know if it is possible to change the size of the form when it is moved?
What I want to accomplish with this, is that when a user moves the form between 2 different screens the form should change its size to fit the new screen.
I tried with the DragDrop action for the Form but didn't work.
Please help!
最满意答案
你有没有检查Move方法是否可以帮到你?
private void Form1_Move(object sender, EventArgs e) { MessageBox.Show(this.Left.ToString()); }上面的示例提示您表单的左侧位置,以便您可以检查表单的当前位置,并在必要时尝试调整其大小。
Have you check if Move method can help you ?
private void Form1_Move(object sender, EventArgs e) { MessageBox.Show(this.Left.ToString()); }The example above prompt the left position of your form, so you can check the current position of your Form and try to resize it if necessary.
更多推荐
发布评论