【问题标题】:How to develop win form application for the system with the resolution of 1080*19201080*1920分辨率系统如何开发win表格应用
【发布时间】:2019-06-23 14:54:48
【问题描述】:

我想开发一个 Windows 窗体应用程序,其中目标系统的屏幕分辨率为 1080x1920。但我的系统不接受该分辨率。即使我无法将我的 winform 大小设置为 1080x1920。 谁能帮我解决这个问题

【问题讨论】:

  • ..这是垂直旋转的屏幕吗?标准高清尺寸为 1920x1080,因此除非您为垂直(纵向)屏幕设计此表单,否则您的 x 和 y 可能会向后
  • 这个屏幕是旋转的。
  • 我建议一种方法。在表单设计器代码中创建一个 if 代码,如果为真,您的按钮和其他表单人员将根据百分比计算创建
  • 我该如何设计呢?
  • 解释“我的系统不接受该分辨率”是什么意思。

标签: c# winforms


【解决方案1】:

这对我有用。这是表单的 Load 事件(您可以通过在设计器中双击表单来生成它)。在这种情况下,我们检查包含表单的屏幕的当前尺寸。然后我们将表单大小设置为匹配。我们还将窗体的位置移动到 0, 0,这样它就不会从屏幕上剪掉。

    //the name of this function will be different for you.
    //generate this function by double clicking the form in designer.
    //the code inside the function is what you're interested in.
    private void MainForm_Load(object sender, EventArgs e)
    {
        Rectangle screenSize = Screen.GetBounds(this); //find out the current screen size
        this.Top = 0; //move the form to top
        this.Left = 0; //move the form to left
        this.Width = screenSize.Width; //set form width to screen width
        this.Height = screenSize.Height; //set form height to screen height
    }

编辑:另外,为什么不最大化?

        this.WindowState = FormWindowState.Maximized;

【讨论】:

    猜你喜欢
    • 2015-11-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多