广告
返回顶部
首页 > 资讯 > 后端开发 > 其他教程 >C#实现设置电脑显示器参数
  • 612
分享到

C#实现设置电脑显示器参数

C#设置电脑显示器参数C#设置显示器参数C#显示器 2022-12-19 06:12:29 612人浏览 安东尼
摘要

目录实践过程效果代码实践过程 效果 代码 public partial class FORM1 : Form { public Form1() {

实践过程

效果

代码

public partial class FORM1 : Form
{
    public Form1()
    {
        InitializeComponent();
    }
    string MaxValue;//显示器支持的最大刷新率
    string MinValue;//显示器支持的最小刷新率
    string NowValue;//当前刷新率
    bool flag = true;

    public const uint WM_SYSCOMMAND = 0x0112;
    public const uint SC_MONITORPOWER = 0xF170;
    [DllImport("user32")]
    public static extern IntPtr SendMessage(IntPtr hWnd, uint wMsg, uint wParam, int lParam);

    public enum DMDO
    {
        DEFAULT = 0,
        D90 = 1,
        D180 = 2,
        D270 = 3
    }

    [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
    struct DEVMODE
    {
        public const int DM_DISPLAYFREQUENCY = 0x400000;
        public const int DM_PELSWIDTH = 0x80000;
        public const int DM_PELSHEIGHT = 0x100000;
        public const int DM_BITSPERPEL = 262144;
        private const int CCHDEVICENAME = 32;
        private const int CCHFORMNAME = 32;
        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = CCHDEVICENAME)]
        public string dmDeviceName;
        public short dmSpecVersion;
        public short dmDriverVersion;
        public short dmSize;
        public short dmDriverExtra;
        public int dmFields;
        public int dmPositionX;
        public int dmPositionY;
        public DMDO dmDisplayOrientation;
        public int dmDisplayFixedOutput;
        public short dmColor;
        public short dmDuplex;
        public short dmYResolution;
        public short dmTTOption;
        public short dmCollate;
        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = CCHFORMNAME)]
        public string dmFormName;
        public short dmLogPixels;
        public int dmBitsPerPel;
        public int dmPelsWidth;
        public int dmPelsHeight;
        public int dmDisplayFlags;
        public int dmDisplayFrequency;
        public int dmICMMethod;
        public int dmICMIntent;
        public int dmMediaType;
        public int dmDitherType;
        public int dmReserved1;
        public int dmReserved2;
        public int dmPanningWidth;
        public int dmPanningHeight;
    }

    [DllImport("user32.dll", CharSet = CharSet.Auto)]
    static extern int ChangeDisplaySettings([In] ref DEVMODE lpDevMode, int dwFlags);


    private void Form1_Load(object sender, EventArgs e)
    {
        groupBox5.Text = "当前时间:" + DateTime.Now.ToString();
        ManagementObjectSearcher searcher = new ManagementObjectSearcher("select * from Win32_VideoController");
        foreach(ManagementObject myobject in searcher.Get() )
        {
            string Vname = myobject["Name"].ToString();
            if (Vname.Length >40)
            {
                string a = Vname.Substring(0,45);
                string b = Vname.Substring(46);
                lblInfo.Text = a + "\n" + b;
            }
            else
            {
                lblInfo.Text = Vname;
            }
            string colorValue = myobject["CurrentNumberOfColors"].ToString();
            if (colorValue == "65536")
            {
                comboBox1.SelectedIndex = 0;
            }
            else
            {
                comboBox1.SelectedIndex = 1;
            }
            MaxValue=myobject["MaxRefreshRate"].ToString();
            if (Convert.ToInt32(MaxValue) > 85)
                MaxValue = "85";
            MinValue = myobject["MinRefreshRate"].ToString();
            NowValue=myobject["CurrentRefreshRate"].ToString();
            AddHZ();
            GetDis();
            ChangeDis(1);
        }

    }
    int dWidth = 0;
    int dHeight = 0;
    private void GetDis()//获取分辨率
    {
        Size s = SystemInformation.PrimaryMonitorSize;
        dWidth = s.Width;
        dHeight = s.Height;
        lblDisInfo.Text = dWidth.ToString() + " × " + dHeight.ToString() + " 像素";
    }

    private void ChangeDis(int i)//变换分辨率
    {
        int dValue;
        dValue = trackBar1.Value;
        if (i == 0)
        {
            switch (dValue)
            {
                case 0: dWidth = 800; dHeight = 600; break;
                case 1: dWidth = 1024; dHeight = 768; break;
                case 2: dWidth = 1152; dHeight = 864; break;
                case 3: dWidth = 1280; dHeight = 600; break;
                case 4: dWidth = 1280; dHeight = 720; break;
                case 5: dWidth = 1280; dHeight = 768; break;
                case 6: dWidth = 1280; dHeight = 760; break;
                case 7: dWidth = 1280; dHeight = 1024; break;
                case 8: dWidth = 1400; dHeight = 1050; break;
                case 9: dWidth = 1600; dHeight = 900; break;
                case 10: dWidth = 1600; dHeight = 1200; break;
            }
            lblDisInfo.Text = dWidth.ToString() + " × " + dHeight.ToString() + " 像素";
        }
        else
        {
            int dSum=dWidth+dHeight;
            switch (dSum)
            {
                case 1400: trackBar1.Value = 0; break;
                case 1792: trackBar1.Value = 1; break;
                case 2016: trackBar1.Value = 2; break;
                case 1880: trackBar1.Value = 3; break;
                case 2000: trackBar1.Value = 4; break;
                case 2048: trackBar1.Value = 5; break;
                case 2240: trackBar1.Value = 6; break;
                case 2304: trackBar1.Value = 7; break;
                case 2450: trackBar1.Value = 8; break;
                case 2500: trackBar1.Value = 9; break;
                case 2800: trackBar1.Value = 10; break;
            }
        }
    }


    private void AddHZ()
    {
        int[] hz = new int[] { 60, 70, 75, 85, 100, 120 };
        comboBox2.Items.Clear();
        if (checkBox1.Checked)
        {
            for (int i = 0; i < hz.Length; i++)
            {
                if (hz[i] <= Convert.ToInt32(MaxValue))
                {
                    comboBox2.Items.Add(hz[i].ToString() + "赫兹");
                }
            }
            comboBox2.Text = NowValue + "赫兹";
        }
        else
        {
            for (int j = 0; j < hz.Length; j++)
            {
                comboBox2.Items.Add(hz[j].ToString() + "赫兹");
            }
            comboBox2.Text = NowValue + "赫兹";
        }
    }

    private void checkBox1_CheckedChanged(object sender, EventArgs e)
    {
        AddHZ();
    }

    private void button2_Click(object sender, EventArgs e)
    {
        Application.Exit();
    }

    private void trackBar1_Scroll(object sender, EventArgs e)
    {
        ChangeDis(0);
    }

    private void radioButton1_CheckedChanged(object sender, EventArgs e)
    {
        if (radioButton1.Checked)
        {
            groupBox1.Enabled = true;
            groupBox2.Enabled = true;
            groupBox3.Enabled = true;
            groupBox4.Enabled = true;
        }
        else
        {
            groupBox1.Enabled = false;
            groupBox2.Enabled = false;
            groupBox3.Enabled = false;
            groupBox4.Enabled = false;
        }
    }

    private void radioButton2_CheckedChanged(object sender, EventArgs e)
    {
        if (radioButton2.Checked)
        {
            groupBox5.Enabled = true;
        }
        else
        {
            groupBox5.Enabled = false;
        }
    }

    private void button1_Click(object sender, EventArgs e)
    {
        if (radioButton1.Checked)//设置分辨率、颜色质量、刷新率
        {
            long RetVal = 0;
            DEVMODE dm = new DEVMODE();
            dm.dmSize = (short)Marshal.SizeOf(typeof(DEVMODE));
            dm.dmPelsWidth = dWidth;//宽
            dm.dmPelsHeight = dHeight;//高
            int f =Convert.ToInt32(comboBox2.Text.Trim().Remove(comboBox2.Text.Trim().Length-2));
            dm.dmDisplayFrequency = f;//刷新率
            if (comboBox1.SelectedIndex == 0)
                dm.dmBitsPerPel = 16;
            else
                dm.dmBitsPerPel = 32;
            dm.dmFields = DEVMODE.DM_PELSWIDTH | DEVMODE.DM_PELSHEIGHT | DEVMODE.DM_DISPLAYFREQUENCY | DEVMODE.DM_BITSPERPEL;
            RetVal = ChangeDisplaySettings(ref dm, 0);
        }
        if (radioButton2.Checked)//关闭显示器
        {
            timer1.Start();
            this.Close();
        }
    }

    private void timer1_Tick(object sender, EventArgs e)
    {
        if (dateTimePicker1.Text == DateTime.Now.ToLongTimeString())
        {
            SendMessage(this.Handle, WM_SYSCOMMAND, SC_MONITORPOWER, 2);
            timer1.Stop();
        }
    }

    private void Form1_FormClosing(object sender, FormClosingEventArgs e)
    {
        this.Hide();
        if (flag)
        {
            e.Cancel = true;
        }
    }

    private void 退出ToolStripMenuItem_Click(object sender, EventArgs e)
    {
        flag = false;
        Application.Exit();
    }

    private void 显示ToolStripMenuItem_Click(object sender, EventArgs e)
    {
        this.Show();
    }

    private void notifyIcon1_MouseDoubleClick(object sender, MouseEventArgs e)
    {
        this.Show();
    }

    private void timer2_Tick(object sender, EventArgs e)
    {
        groupBox5.Text = "当前时间:" + DateTime.Now.ToString();
    }
}
partial class Form1
{
    /// <summary>
    /// 必需的设计器变量。
    /// </summary>
    private System.ComponentModel.IContainer components = null;

    /// <summary>
    /// 清理所有正在使用的资源。
    /// </summary>
    /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
    protected override void Dispose(bool disposing)
    {
        if (disposing && (components != null))
        {
            components.Dispose();
        }
        base.Dispose(disposing);
    }

    #region windows 窗体设计器生成的代码

    /// <summary>
    /// 设计器支持所需的方法 - 不要
    /// 使用代码编辑器修改此方法的内容。
    /// </summary>
    private void InitializeComponent()
    {
        this.components = new System.ComponentModel.Container();
        System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
        this.groupBox1 = new System.Windows.Forms.GroupBox();
        this.lblDisInfo = new System.Windows.Forms.Label();
        this.label2 = new System.Windows.Forms.Label();
        this.label1 = new System.Windows.Forms.Label();
        this.trackBar1 = new System.Windows.Forms.TrackBar();
        this.groupBox2 = new System.Windows.Forms.GroupBox();
        this.lblInfo = new System.Windows.Forms.Label();
        this.groupBox3 = new System.Windows.Forms.GroupBox();
        this.comboBox1 = new System.Windows.Forms.ComboBox();
        this.groupBox4 = new System.Windows.Forms.GroupBox();
        this.checkBox1 = new System.Windows.Forms.CheckBox();
        this.comboBox2 = new System.Windows.Forms.ComboBox();
        this.groupBox5 = new System.Windows.Forms.GroupBox();
        this.dateTimePicker1 = new System.Windows.Forms.DateTimePicker();
        this.label4 = new System.Windows.Forms.Label();
        this.button1 = new System.Windows.Forms.Button();
        this.button2 = new System.Windows.Forms.Button();
        this.radioButton1 = new System.Windows.Forms.RadioButton();
        this.radioButton2 = new System.Windows.Forms.RadioButton();
        this.timer1 = new System.Windows.Forms.Timer(this.components);
        this.notifyIcon1 = new System.Windows.Forms.NotifyIcon(this.components);
        this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
        this.显示ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
        this.退出ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
        this.timer2 = new System.Windows.Forms.Timer(this.components);
        this.groupBox1.SuspendLayout();
        ((System.ComponentModel.ISupportInitialize)(this.trackBar1)).BeginInit();
        this.groupBox2.SuspendLayout();
        this.groupBox3.SuspendLayout();
        this.groupBox4.SuspendLayout();
        this.groupBox5.SuspendLayout();
        this.contextMenuStrip1.SuspendLayout();
        this.SuspendLayout();
        // 
        // groupBox1
        // 
        this.groupBox1.Controls.Add(this.lblDisInfo);
        this.groupBox1.Controls.Add(this.label2);
        this.groupBox1.Controls.Add(this.label1);
        this.groupBox1.Controls.Add(this.trackBar1);
        this.groupBox1.Location = new System.Drawing.Point(11, 96);
        this.groupBox1.Name = "groupBox1";
        this.groupBox1.Size = new System.Drawing.Size(161, 81);
        this.groupBox1.TabIndex = 0;
        this.groupBox1.TabStop = false;
        this.groupBox1.Text = "屏幕分辨率";
        // 
        // lblDisInfo
        // 
        this.lblDisInfo.AutoSize = true;
        this.lblDisInfo.Location = new System.Drawing.Point(36, 57);
        this.lblDisInfo.Name = "lblDisInfo";
        this.lblDisInfo.Size = new System.Drawing.Size(41, 12);
        this.lblDisInfo.TabIndex = 3;
        this.lblDisInfo.Text = "label3";
        // 
        // label2
        // 
        this.label2.AutoSize = true;
        this.label2.Location = new System.Drawing.Point(134, 29);
        this.label2.Name = "label2";
        this.label2.Size = new System.Drawing.Size(17, 12);
        this.label2.TabIndex = 2;
        this.label2.Text = "多";
        // 
        // label1
        // 
        this.label1.AutoSize = true;
        this.label1.Location = new System.Drawing.Point(15, 29);
        this.label1.Name = "label1";
        this.label1.Size = new System.Drawing.Size(17, 12);
        this.label1.TabIndex = 1;
        this.label1.Text = "少";
        // 
        // trackBar1
        // 
        this.trackBar1.AutoSize = false;
        this.trackBar1.Location = new System.Drawing.Point(33, 26);
        this.trackBar1.Name = "trackBar1";
        this.trackBar1.Size = new System.Drawing.Size(95, 23);
        this.trackBar1.TabIndex = 0;
        this.trackBar1.Scroll += new System.EventHandler(this.trackBar1_Scroll);
        // 
        // groupBox2
        // 
        this.groupBox2.Controls.Add(this.lblInfo);
        this.groupBox2.Location = new System.Drawing.Point(12, 36);
        this.groupBox2.Name = "groupBox2";
        this.groupBox2.Size = new System.Drawing.Size(328, 53);
        this.groupBox2.TabIndex = 2;
        this.groupBox2.TabStop = false;
        this.groupBox2.Text = "显示设备";
        // 
        // lblInfo
        // 
        this.lblInfo.AutoSize = true;
        this.lblInfo.Location = new System.Drawing.Point(10, 20);
        this.lblInfo.Name = "lblInfo";
        this.lblInfo.Size = new System.Drawing.Size(41, 12);
        this.lblInfo.TabIndex = 0;
        this.lblInfo.Text = "label3";
        // 
        // groupBox3
        // 
        this.groupBox3.Controls.Add(this.comboBox1);
        this.groupBox3.Location = new System.Drawing.Point(178, 96);
        this.groupBox3.Name = "groupBox3";
        this.groupBox3.Size = new System.Drawing.Size(161, 81);
        this.groupBox3.TabIndex = 3;
        this.groupBox3.TabStop = false;
        this.groupBox3.Text = "颜色质量";
        // 
        // comboBox1
        // 
        this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
        this.comboBox1.FormattingEnabled = true;
        this.comboBox1.Items.AddRange(new object[] {
        "中(16位)",
        "最高(32位)"});
        this.comboBox1.Location = new System.Drawing.Point(7, 31);
        this.comboBox1.Name = "comboBox1";
        this.comboBox1.Size = new System.Drawing.Size(148, 20);
        this.comboBox1.TabIndex = 0;
        // 
        // groupBox4
        // 
        this.groupBox4.Controls.Add(this.checkBox1);
        this.groupBox4.Controls.Add(this.comboBox2);
        this.groupBox4.Location = new System.Drawing.Point(12, 184);
        this.groupBox4.Name = "groupBox4";
        this.groupBox4.Size = new System.Drawing.Size(327, 85);
        this.groupBox4.TabIndex = 4;
        this.groupBox4.TabStop = false;
        this.groupBox4.Text = "设置刷新频率";
        // 
        // checkBox1
        // 
        this.checkBox1.AutoSize = true;
        this.checkBox1.Checked = true;
        this.checkBox1.CheckState = System.Windows.Forms.CheckState.Checked;
        this.checkBox1.Location = new System.Drawing.Point(7, 56);
        this.checkBox1.Name = "checkBox1";
        this.checkBox1.Size = new System.Drawing.Size(180, 16);
        this.checkBox1.TabIndex = 1;
        this.checkBox1.Text = "隐藏该显示器无法显示的模式";
        this.checkBox1.UseVisualStyleBackColor = true;
        this.checkBox1.CheckedChanged += new System.EventHandler(this.checkBox1_CheckedChanged);
        // 
        // comboBox2
        // 
        this.comboBox2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
        this.comboBox2.FormattingEnabled = true;
        this.comboBox2.Items.AddRange(new object[] {
        "60赫兹",
        "70赫兹",
        "75赫兹",
        "85赫兹",
        "100赫兹",
        "120赫兹"});
        this.comboBox2.Location = new System.Drawing.Point(6, 20);
        this.comboBox2.Name = "comboBox2";
        this.comboBox2.Size = new System.Drawing.Size(315, 20);
        this.comboBox2.TabIndex = 0;
        // 
        // groupBox5
        // 
        this.groupBox5.Controls.Add(this.dateTimePicker1);
        this.groupBox5.Controls.Add(this.label4);
        this.groupBox5.Enabled = false;
        this.groupBox5.Location = new System.Drawing.Point(12, 296);
        this.groupBox5.Name = "groupBox5";
        this.groupBox5.Size = new System.Drawing.Size(328, 65);
        this.groupBox5.TabIndex = 5;
        this.groupBox5.TabStop = false;
        // 
        // dateTimePicker1
        // 
        this.dateTimePicker1.Checked = false;
        this.dateTimePicker1.Format = System.Windows.Forms.DateTimePickerFormat.Time;
        this.dateTimePicker1.Location = new System.Drawing.Point(94, 24);
        this.dateTimePicker1.Name = "dateTimePicker1";
        this.dateTimePicker1.ShowCheckBox = true;
        this.dateTimePicker1.ShowUpDown = true;
        this.dateTimePicker1.Size = new System.Drawing.Size(118, 21);
        this.dateTimePicker1.TabIndex = 1;
        // 
        // label4
        // 
        this.label4.AutoSize = true;
        this.label4.Location = new System.Drawing.Point(11, 28);
        this.label4.Name = "label4";
        this.label4.Size = new System.Drawing.Size(77, 12);
        this.label4.TabIndex = 0;
        this.label4.Text = "关闭显示器:";
        // 
        // button1
        // 
        this.button1.Location = new System.Drawing.Point(84, 372);
        this.button1.Name = "button1";
        this.button1.Size = new System.Drawing.Size(75, 23);
        this.button1.TabIndex = 6;
        this.button1.Text = "确定";
        this.button1.UseVisualStyleBackColor = true;
        this.button1.Click += new System.EventHandler(this.button1_Click);
        // 
        // button2
        // 
        this.button2.Location = new System.Drawing.Point(177, 372);
        this.button2.Name = "button2";
        this.button2.Size = new System.Drawing.Size(75, 23);
        this.button2.TabIndex = 7;
        this.button2.Text = "取消";
        this.button2.UseVisualStyleBackColor = true;
        this.button2.Click += new System.EventHandler(this.button2_Click);
        // 
        // radioButton1
        // 
        this.radioButton1.AutoSize = true;
        this.radioButton1.Checked = true;
        this.radioButton1.Location = new System.Drawing.Point(11, 12);
        this.radioButton1.Name = "radioButton1";
        this.radioButton1.Size = new System.Drawing.Size(71, 16);
        this.radioButton1.TabIndex = 8;
        this.radioButton1.TabStop = true;
        this.radioButton1.Text = "基本设置";
        this.radioButton1.UseVisualStyleBackColor = true;
        this.radioButton1.CheckedChanged += new System.EventHandler(this.radioButton1_CheckedChanged);
        // 
        // radioButton2
        // 
        this.radioButton2.AutoSize = true;
        this.radioButton2.Location = new System.Drawing.Point(11, 278);
        this.radioButton2.Name = "radioButton2";
        this.radioButton2.Size = new System.Drawing.Size(71, 16);
        this.radioButton2.TabIndex = 9;
        this.radioButton2.Text = "电源设置";
        this.radioButton2.UseVisualStyleBackColor = true;
        this.radioButton2.CheckedChanged += new System.EventHandler(this.radioButton2_CheckedChanged);
        // 
        // timer1
        // 
        this.timer1.Interval = 1000;
        this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
        // 
        // notifyIcon1
        // 
        this.notifyIcon1.ContextMenuStrip = this.contextMenuStrip1;
        this.notifyIcon1.Icon = ((System.Drawing.Icon)(resources.GetObject("notifyIcon1.Icon")));
        this.notifyIcon1.Text = "显示器控制";
        this.notifyIcon1.Visible = true;
        this.notifyIcon1.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.notifyIcon1_MouseDoubleClick);
        // 
        // contextMenuStrip1
        // 
        this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
        this.显示ToolStripMenuItem,
        this.退出ToolStripMenuItem});
        this.contextMenuStrip1.Name = "contextMenuStrip1";
        this.contextMenuStrip1.Size = new System.Drawing.Size(95, 48);
        // 
        // 显示ToolStripMenuItem
        // 
        this.显示ToolStripMenuItem.Name = "显示ToolStripMenuItem";
        this.显示ToolStripMenuItem.Size = new System.Drawing.Size(94, 22);
        this.显示ToolStripMenuItem.Text = "显示";
        this.显示ToolStripMenuItem.Click += new System.EventHandler(this.显示ToolStripMenuItem_Click);
        // 
        // 退出ToolStripMenuItem
        // 
        this.退出ToolStripMenuItem.Name = "退出ToolStripMenuItem";
        this.退出ToolStripMenuItem.Size = new System.Drawing.Size(94, 22);
        this.退出ToolStripMenuItem.Text = "退出";
        this.退出ToolStripMenuItem.Click += new System.EventHandler(this.退出ToolStripMenuItem_Click);
        // 
        // timer2
        // 
        this.timer2.Enabled = true;
        this.timer2.Interval = 1000;
        this.timer2.Tick += new System.EventHandler(this.timer2_Tick);
        // 
        // Form1
        // 
        this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
        this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
        this.ClientSize = new System.Drawing.Size(351, 403);
        this.Controls.Add(this.radioButton2);
        this.Controls.Add(this.radioButton1);
        this.Controls.Add(this.button2);
        this.Controls.Add(this.button1);
        this.Controls.Add(this.groupBox5);
        this.Controls.Add(this.groupBox4);
        this.Controls.Add(this.groupBox3);
        this.Controls.Add(this.groupBox2);
        this.Controls.Add(this.groupBox1);
        this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
        this.MaximizeBox = false;
        this.MinimizeBox = false;
        this.Name = "Form1";
        this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
        this.Text = "显示器控制";
        this.Load += new System.EventHandler(this.Form1_Load);
        this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing);
        this.groupBox1.ResumeLayout(false);
        this.groupBox1.PerformLayout();
        ((System.ComponentModel.ISupportInitialize)(this.trackBar1)).EndInit();
        this.groupBox2.ResumeLayout(false);
        this.groupBox2.PerformLayout();
        this.groupBox3.ResumeLayout(false);
        this.groupBox4.ResumeLayout(false);
        this.groupBox4.PerformLayout();
        this.groupBox5.ResumeLayout(false);
        this.groupBox5.PerformLayout();
        this.contextMenuStrip1.ResumeLayout(false);
        this.ResumeLayout(false);
        this.PerformLayout();

    }

    #endregion

    private System.Windows.Forms.GroupBox groupBox1;
    private System.Windows.Forms.Label label2;
    private System.Windows.Forms.Label label1;
    private System.Windows.Forms.TrackBar trackBar1;
    private System.Windows.Forms.Label lblDisInfo;
    private System.Windows.Forms.GroupBox groupBox2;
    private System.Windows.Forms.GroupBox groupBox3;
    private System.Windows.Forms.ComboBox comboBox1;
    private System.Windows.Forms.GroupBox groupBox4;
    private System.Windows.Forms.ComboBox comboBox2;
    private System.Windows.Forms.CheckBox checkBox1;
    private System.Windows.Forms.GroupBox groupBox5;
    private System.Windows.Forms.Label label4;
    private System.Windows.Forms.Button button1;
    private System.Windows.Forms.Button button2;
    private System.Windows.Forms.Label lblInfo;
    private System.Windows.Forms.RadioButton radioButton1;
    private System.Windows.Forms.RadioButton radioButton2;
    private System.Windows.Forms.DateTimePicker dateTimePicker1;
    private System.Windows.Forms.Timer timer1;
    private System.Windows.Forms.NotifyIcon notifyIcon1;
    private System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
    private System.Windows.Forms.ToolStripMenuItem 显示ToolStripMenuItem;
    private System.Windows.Forms.ToolStripMenuItem 退出ToolStripMenuItem;
    private System.Windows.Forms.Timer timer2;
}

到此这篇关于C#实现设置电脑显示器参数的文章就介绍到这了,更多相关C#设置电脑显示器参数内容请搜索编程网以前的文章或继续浏览下面的相关文章希望大家以后多多支持编程网!

--结束END--

本文标题: C#实现设置电脑显示器参数

本文链接: https://www.lsjlt.com/news/175182.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
  • C#实现设置电脑显示器参数
    目录实践过程效果代码实践过程 效果 代码 public partial class Form1 : Form { public Form1() { ...
    99+
    2022-12-19
    C#设置电脑显示器参数 C#设置显示器参数 C# 显示器
  • 双显示器设置:如何设置一台电脑两个显示器
    双显示器设置,如何设置一台电脑两个显示器:一般来说一台电脑通常只配一个显示器,在我们平时的的工作、娱乐基本上都是这样的搭配。但是这种用法,当您打开多个窗口的时候,一个显示器空间就显得很晓,尤其是做一些复杂工作,比如分析图...
    99+
    2023-05-26
    台式机设置双显示器 双显示器设置 电脑 显示器
  • win10电脑怎么设置两个显示器
    本篇内容主要讲解“win10电脑怎么设置两个显示器”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“win10电脑怎么设置两个显示器”吧!设置方法:找到电脑上面的外置接口,使用电脑与显示器连接线把电...
    99+
    2023-06-28
  • 如何设置一台电脑两个显示器
    这篇文章将为大家详细讲解有关如何设置一台电脑两个显示器,文章内容质量较高,因此小编分享给大家做个参考,希望大家阅读完这篇文章后对相关知识有一定的了解。双显示器设置,如何设置一台电脑两个显示器:一般来说一台电脑通常只配一个显示器,在我们平时的...
    99+
    2023-06-14
  • win11电脑显示器刷新率怎么设置
    今天小编给大家分享一下win11电脑显示器刷新率怎么设置的相关知识点,内容详细,逻辑清晰,相信大部分人都还太了解这方面的知识,所以分享这篇文章给大家参考一下,希望大家阅读完这篇文章后有所收获,下面我们一起来了解一下吧。首先打开图示位置的“开...
    99+
    2023-07-02
  • win10电脑显示器的刷新频率怎么设置
    本篇内容主要讲解“win10电脑显示器的刷新频率怎么设置”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“win10电脑显示器的刷新频率怎么设置”吧!一、在桌面上右键单击选择:显示设置。二、找到高级...
    99+
    2023-06-28
  • Mac电脑外接多个显示器的设置教程
    使用MacBook的朋友如果是专业使用,多数人都会选择外接一个大的显示器,那么要如何设置MacBook的多个显示器呢?Mac多屏显示的方法很简单,直接插上外接显示器,然后进行下设置就可以了,苹果官方给出了详细的教程,不会的朋友一起来看看吧。...
    99+
    2023-06-05
  • 电脑23寸显示器最佳分辨率如何设置
    本文小编为大家详细介绍“电脑23寸显示器最佳分辨率如何设置”,内容详细,步骤清晰,细节处理妥当,希望这篇“电脑23寸显示器最佳分辨率如何设置”文章能帮助大家解决疑惑,下面跟着小编的思路慢慢深入,一起来学习新知识吧。23寸显示器最佳分辨率设置...
    99+
    2023-07-01
  • 亚马逊电脑服务器怎么设置地址显示
    打开亚马逊控制面板(Amazon 控制面板),并选择“网络和 Internet”。 选择“Internet Settings”。 选择“Web和Port”选项卡。 找到“Add new address”按钮,点击它并输入新的地址。 在新地...
    99+
    2023-10-27
    亚马逊 地址 服务器
  • 笔记本电脑屏幕当显示器用怎么设置
    这篇“笔记本电脑屏幕当显示器用怎么设置”文章的知识点大部分人都不太理解,所以小编给大家总结了以下内容,内容详细,步骤清晰,具有一定的借鉴价值,希望大家阅读完这篇文章能有所收获,下面我们一起来看看这篇“笔记本电脑屏幕当显示器用怎么设置”文章吧...
    99+
    2023-07-02
  • prompt如何设置实现登陆MySQL显示用户名及当前数据库
    下文给大家带来有关prompt如何设置实现登陆MySQL显示用户名及当前数据库内容,相信大家一定看过类似的文章。我们给大家带来的有何不同呢?一起来看看正文部分吧,相信看完prompt如何设置实现登陆MySQ...
    99+
    2022-10-18
  • 如何实现linux Vi编辑器代码高亮设置及永久显示行号
    这篇文章主要讲解了“如何实现linux Vi编辑器代码高亮设置及永久显示行号”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“如何实现linux Vi编辑器代码高亮设置及永久显示行号”吧!Vi编...
    99+
    2023-06-12
  • 宝塔设置云服务器mysql端口转发,实现本地电脑访问云mysql
    环境:centos系统使用宝塔面板 实现功能:宝塔设置云服务器mysql端口转发,实现本地电脑访问mysql 1.安装mysql、PHP-7.4.33、phpMyAdmin 5.0 软件商店==》搜索...
    99+
    2023-09-08
    服务器 mysql adb
  • ssm咖啡销售系统电脑设计实现 51842 (免费领源码、附论文)可做计算机毕业设计JAVA、PHP、爬虫、APP、小程序、C#、C++、python、数据可视化、大数据、全套文案
    摘 要 科技进步的飞速发展引起人们日常生活的巨大变化,电子信息技术的飞速发展使得电子信息技术的各个领域的应用水平得到普及和应用。信息时代的到来已成为不可阻挡的时尚潮流,人类发展的历史正进入一个新时代。现代社会越来越多的人追求便捷购...
    99+
    2023-10-26
    课程设计 java php 宠物 spring boot 爬虫 小程序
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作