zoukankan      html  css  js  c++  java
  • C#更改颜色和字体

    实现效果

    1,窗口中添加colorDialog与fontDialog工具

    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;
    using System.IO;
    using System.Drawing.Drawing2D;
    
    namespace App1
    {
        public partial class Form1 : Form
        {
            public Form1()
            {
                InitializeComponent();
            }
    
            private void Button1_Click(object sender, EventArgs e)
            {
                if (colorDialog1.ShowDialog()==DialogResult.OK)
                {
                    label1.ForeColor = colorDialog1.Color;
                }
            }
    
            private void Button2_Click(object sender, EventArgs e)
            {
                if (fontDialog1.ShowDialog()==DialogResult.OK)
                {
                    label1.Font = fontDialog1.Font;
                }
            }
        }
    }
    App1
  • 相关阅读:
    一种想法
    识别link_text
    识别name
    识别id
    文件的读写
    条件和循环
    网站测试-功能测试小结
    拷贝
    #团队博客作业1-小组成员介绍
    软件测试基础-Homework1
  • 原文地址:https://www.cnblogs.com/Luck1996/p/11980745.html
Copyright © 2011-2022 走看看