表单设计-设计期间不能使表单大于屏幕分辨率

时间:2019-02-05 18:16:49

标签: visual-studio winforms visual-studio-2017

我正在使用分辨率如1366x768的笔记本电脑。我想为使用更高分辨率的用户设计一个Winform表单。但是我无法在设计中使表格更大。 而且,当我将笔记本电脑的分辨率切换为较小尺寸时,表格尺寸减小了。

我读到一个类似的问题:https://social.msdn.microsoft.com/Forums/vstudio/en-US/00e5efce-bf4f-4e80-95e6-4e08b1ad9ac6/cant-resize-form?forum=winforms 他们说,设计比屏幕分辨率更大的表格是不可能的。 是真的吗?

预先感谢您的回答。 杰罗(Jaro)

顺便说一句。 我不需要像http://blogs.artinsoft.net/Mrojas/archive/2011/08/11/Making-a-form-bigger-than-the-Screen-Resolution.aspx

这样的运行时期间调整表单大小
This is just the transliteration of that code in C# just as a reference

using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Windows.Forms;

public class Form1 : Form
{
    [DllImport("User32.dll", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
    private static extern bool MoveWindow(IntPtr hWnd, int x, int y, int w, int h, bool Repaint);

    private void Form1_Load(System.Object sender, System.EventArgs e)
    {
        this.MaximumSize = new Size(5000, 800);
        bool Result = MoveWindow(this.Handle, this.Left, this.Top, 5000, 500, true);
    }
    public Form1()
    {
        Load += Form1_Load;
    }

} 

0 个答案:

没有答案