zoukankan      html  css  js  c++  java
  • C# 技能鉴定 第三单元的题目

    用代码来调整或者编辑窗体的方法,这些方法先将它放在这里,相信以后编程中肯定会用得到的。
    
    

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows.Forms;

    
    

    namespace Test3_3
    {
        public partial class Form1 : Form
        {
            public Form1()
            {
                InitializeComponent();
            }

    
    

            private void Form1_Load(object sender, EventArgs e)
            {

    
    

            }
            private void 黑ToolStripMenuItem_Click(object sender, EventArgs e)
            {
                this.pictureBox1.BackColor = Color.Black;
                this.toolStripStatusLabel1.Text = "黑色";
            }

    
    

            private void 白色WToolStripMenuItem_Click(object sender, EventArgs e)
            {
                this.pictureBox1.BackColor = Color.White;
                this.toolStripStatusLabel1.Text = "白色";
            }

    
    

            private void 紫色PToolStripMenuItem_Click(object sender, EventArgs e)
            {
                this.pictureBox1.BackColor = Color.Purple;
                this.toolStripStatusLabel1.Text = "紫色";
            }

    
    

            private void toolStripButton1_Click(object sender, EventArgs e)
            {
                this.pictureBox1.BackColor = Color.Black;
                this.toolStripStatusLabel1.Text = "黑色";
            }

    
    

            private void toolStripButton2_Click(object sender, EventArgs e)
            {
                this.pictureBox1.BackColor = Color.White;
                this.toolStripStatusLabel1.Text = "白色";
            }

    
    

            private void toolStripButton3_Click(object sender, EventArgs e)
            {
                this.pictureBox1.BackColor = Color.Purple;
                this.toolStripStatusLabel1.Text = "紫色";
            }
        }
    }

    
    

     

    Test3_1:
    using
    System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace test_3._1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void toolStripButton1_Click(object sender, EventArgs e) { } private void 大BToolStripMenuItem_Click(object sender, EventArgs e) { this.Size = new Size(600, 400); this.toolStripStatusLabel1.Text = "大窗体"; } private void 中MToolStripMenuItem_Click(object sender, EventArgs e) { this.Size = new Size(300, 200); this.toolStripStatusLabel1.Text = "中窗体"; } private void 小SToolStripMenuItem_Click(object sender, EventArgs e) { this.Size = new Size(150, 120); this.toolStripStatusLabel1.Text = "小窗体"; } private void toolStripButton1_Click_1(object sender, EventArgs e) { this.Size = new Size(600, 400); this.toolStripStatusLabel1.Text = "大窗体"; } private void toolStripButton2_Click(object sender, EventArgs e) { this.Size = new Size(300, 200); this.toolStripStatusLabel1.Text = "中窗体"; } private void toolStripButton3_Click(object sender, EventArgs e) { this.Size = new Size(150, 120); this.toolStripStatusLabel1.Text = "小窗体"; } } }



    Test3_2:

     1 using System;
     2 using System.Collections.Generic;
     3 using System.ComponentModel;
     4 using System.Data;
     5 using System.Drawing;
     6 using System.Linq;
     7 using System.Text;
     8 using System.Threading.Tasks;
     9 using System.Windows.Forms;
    10 
    11 namespace Test3_2
    12 {
    13     public partial class Form1 : Form
    14     {
    15         public Form1()
    16         {
    17             InitializeComponent();
    18         }
    19 
    20         private void 红色RToolStripMenuItem_Click(object sender, EventArgs e)
    21         {
    22             this.BackColor = Color.Red;
    23             this.toolStripStatusLabel1.Text = "红色";
    24         }
    25 
    26         private void 绿色GToolStripMenuItem_Click(object sender, EventArgs e)
    27         {
    28             this.BackColor = Color.Green;
    29             this.toolStripStatusLabel1.Text = "绿色";
    30         }
    31 
    32         private void 蓝色BToolStripMenuItem_Click(object sender, EventArgs e)
    33         {
    34             this.BackColor = Color.Blue;
    35             this.toolStripStatusLabel1.Text = "蓝色";
    36         }
    37 
    38         private void toolStripButton1_Click(object sender, EventArgs e)
    39         {
    40             this.BackColor = Color.Red;
    41             this.toolStripStatusLabel1.Text = "红色";
    42         }
    43 
    44         private void toolStripButton2_Click(object sender, EventArgs e)
    45         {
    46             this.BackColor = Color.Green;
    47             this.toolStripStatusLabel1.Text = "绿色";
    48         }
    49 
    50         private void toolStripButton3_Click(object sender, EventArgs e)
    51         {
    52             this.BackColor = Color.Blue;
    53             this.toolStripStatusLabel1.Text = "蓝色";
    54         }
    55     }
    56 }
     
  • 相关阅读:
    bind智能DNS + bindUI管理系统(mysql + bind dlz)
    什么情况下,英文单词中的k发音变g,t发音变d,p发音变b
    rsyn同步软链接保持不变
    yaml,json,ini这三种格式用来做配置文件优缺点
    自动挡车档位介绍
    "挡位"还是"档位",究竟谁错了
    Gitlab备份与恢复、迁移与升级
    树的名称大全
    手动档正确换档手势
    gitlab HA集群
  • 原文地址:https://www.cnblogs.com/chenpengzhou/p/7560864.html
Copyright © 2011-2022 走看看