返回顶部
首页 > 资讯 > 后端开发 > 其他教程 >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://lsjlt.com/news/175182.html(转载时请注明来源链接)

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

猜你喜欢
  • 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
  • 怎么在win10上设置电脑多屏显示
    本篇内容介绍了“怎么在win10上设置电脑多屏显示”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成!设置电脑多屏显示方法:直接点击win10系统...
    99+
    2023-06-27
  • win11我的电脑图标显示如何设置
    这篇文章主要介绍“win11我的电脑图标显示如何设置”的相关知识,小编通过实际案例向大家展示操作过程,操作方法简单快捷,实用性强,希望这篇“win11我的电脑图标显示如何设置”文章能帮助大家解决问题。首先我们点击下方的开始菜单,找到其中的“...
    99+
    2023-07-01
  • 电脑23寸显示器最佳分辨率如何设置
    本文小编为大家详细介绍“电脑23寸显示器最佳分辨率如何设置”,内容详细,步骤清晰,细节处理妥当,希望这篇“电脑23寸显示器最佳分辨率如何设置”文章能帮助大家解决疑惑,下面跟着小编的思路慢慢深入,一起来学习新知识吧。23寸显示器最佳分辨率设置...
    99+
    2023-07-01
  • 笔记本电脑屏幕当显示器用怎么设置
    这篇“笔记本电脑屏幕当显示器用怎么设置”文章的知识点大部分人都不太理解,所以小编给大家总结了以下内容,内容详细,步骤清晰,具有一定的借鉴价值,希望大家阅读完这篇文章能有所收获,下面我们一起来看看这篇“笔记本电脑屏幕当显示器用怎么设置”文章吧...
    99+
    2023-07-02
  • 亚马逊电脑服务器怎么设置地址显示
    打开亚马逊控制面板(Amazon 控制面板),并选择“网络和 Internet”。 选择“Internet Settings”。 选择“Web和Port”选项卡。 找到“Add new address”按钮,点击它并输入新的地址。 在新地...
    99+
    2023-10-27
    亚马逊 地址 服务器
  • 如何设置电脑蓝屏显示详细原因
    这篇文章将为大家详细讲解有关如何设置电脑蓝屏显示详细原因,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。在Cortana搜索栏中输入“regedit”,回车确认,进入注册表编辑器。在注册表编辑器中,依次点击...
    99+
    2023-06-28
  • win8待机界面如怎么设置显示我的电脑?
    新买的window8系统,开机后找不到我的电脑图标的朋友。可以看看下面的方法帮助你快速的找到我的电脑 1、打开电脑,开机待机界面, 2、在空白处,单机右键,选择个性化,单机打开,打开后,如下图 3、在个...
    99+
    2022-06-04
    界面 电脑
  • 安卓版Edge设置默认显示为电脑版布局
    前言 安卓版Edge可以临时显示电脑版布局,同时可以设置默认显示为电脑版布局,该功能适用于安卓平板,设置方法如下。 临时显示电脑版布局 打开安卓版Edge,选择更多,选择查看桌面网站,即可临时显示电脑...
    99+
    2023-09-03
    安卓版Edge 电脑版布局
  • 笔记本电脑怎么设置提高菜单显示速度
    这篇文章给大家分享的是有关笔记本电脑怎么设置提高菜单显示速度的内容。小编觉得挺实用的,因此分享给大家做个参考,一起跟随小编过来看看吧。在运行窗口中输入regdit,点击确定进入注册表编辑器;如图所示:在注册表编辑器中依次点击HEKY-CUR...
    99+
    2023-06-28
  • 使用mysqladmin哪些命令可以显示参数设置
    下文我给大家简单讲讲关于使用mysqladmin哪些命令可以显示参数设置,大家之前了解过相关类似主题内容吗?感兴趣的话就一起来看看这篇文章吧,相信看完使用mysqladmin哪些命令可以显示参数设置对大家多...
    99+
    2024-04-02
  • Python实现设置显示屏分辨率
    目录工具安装完整脚本输出的结果存在的问题工具安装 主要调用win32库实现分辨率获取和读写,需要安装pywin32 示例中是从execl列表中读取需要设置的分辨率,需要安装xlrd ...
    99+
    2023-01-12
    Python设置显示屏分辨率 Python 显示屏分辨率 Python 分辨率
  • 教你电脑win7如何进去bios设置相关参数
    电脑bios是电脑的基本输入输出系统,有很多设置需要在电脑bios内进行设置完成,比如说设置电脑启动项,修改bios密码,超频等等。如何进入win7的bios设置,有网友表达了对此的兴趣。以下是小编为大家提供的win7电脑进入bios的步骤...
    99+
    2023-07-18
  • Win10设置桌面快速显示我的电脑图标以便对电脑进行快捷操作
      Win10刚刚安装完后,有的用户桌面上是没有我的电脑的图标。当然要让电脑桌面显示Win10我的电脑的方法也有很多,本文就来教大家一个快速设置桌面显示我的电脑图标的方法。   1、任务栏上的“文件资源管理...
    99+
    2023-06-17
    Win10 桌面 我的电脑 图标 电脑 操作
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作