FormBorderStyle在最大化时导致表单大小调整问题 [英] FormBorderStyle cause form sizing issue when Maximized

查看:67
本文介绍了FormBorderStyle在最大化时导致表单大小调整问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我有表格。如果我将表单边框样式设置为"SizableToolWindow"。然后,当我最大化表单时,表单的大小占据整个窗口甚至任务栏。我尝试使用以下代码
示例设置表单的最大大小。

I have the form. If I set the Form border style as "SizableToolWindow". then when I am maximizing the form the size of the form occupies the complete window even the task bar. I tried to set the maximum size for the form by using the below code example.

// int wid = SystemInformation.VirtualScreen.Width;
$
// int hei = SystemInformation.VirtualScreen.Height;

    this.MaximumSize = new Size(wid,hei);

// int wid = SystemInformation.VirtualScreen.Width;
// int hei = SystemInformation.VirtualScreen.Height;
    this.MaximumSize = new Size(wid, hei);

但是当表单是格式时,右边和底部还有一个额外的空格最大化。任何人都可以建议解决此问题的解决方案吗?

But still there is a extra space at the right and bottom when the form is maximized. Can anyone please suggest the solution to resolve this issue?




R。 Senthil

R.Senthil

推荐答案

由于此类表单不显示最大化按钮,您可能以编程方式调整大小。然后尝试这种最大化形式的方法:

 
FormBorderStyle =
FormBorderStyle 。相当大;

  FormBorderStyle = FormBorderStyle.Sizable;

< span style ="color:black; font-family:Consolas; font-size:9.5pt">  
WindowState = FormWindowState 。最大化;

  WindowState = FormWindowState.Maximized;

< span style ="color:black; font-family:Consolas; font-size:9.5pt">  
FormBorderStyle = FormBorderStyle 。SizableToolWindow;

  FormBorderStyle = FormBorderStyle.SizableToolWindow;


这篇关于FormBorderStyle在最大化时导致表单大小调整问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆