zoukankan      html  css  js  c++  java
  • C#设置字体和字体颜色和字体样式

    private void radioButton1_CheckedChanged(object sender, System.EventArgs e)
    {
    //设置字体为宋体
    textBox1.Font=new Font("宋体",textBox1.Font.Size,textBox1.Font.Style);
    }

    private void radioButton4_CheckedChanged(object sender, System.EventArgs e)
    {
    //设置字体的大小为12
    textBox1.Font=new Font(textBox1.Font.FontFamily,12,textBox1.Font.Style);
    }

    private void checkBox1_CheckedChanged(object sender, System.EventArgs e)
    {
    //设置字体的风格为加粗
    if(checkBox1.Checked)
    textBox1.Font
    =new Font(textBox1.Font,textBox1.Font.Style|FontStyle.Bold);
    else
    textBox1.Font
    =new Font(textBox1.Font,textBox1.Font.Style^FontStyle.Bold);
    }

    private void checkBox2_CheckedChanged(object sender, System.EventArgs e)
    {
    //设置字体的风格为倾斜
    if(checkBox2.Checked)
    textBox1.Font
    =new Font(textBox1.Font,textBox1.Font.Style|FontStyle.Italic);
    else
    textBox1.Font
    =new Font(textBox1.Font,textBox1.Font.Style^FontStyle.Italic);
    }
  • 相关阅读:
    idea安装
    IntelliJ IDEA 简单使用
    git客户端安装
    一、AJAX
    一、JSP标签介绍,自定义标签
    注解
    线程
    网络编程Socket
    一 批量插入数据(使用批处理
    day87
  • 原文地址:https://www.cnblogs.com/beeone/p/2098002.html
Copyright © 2011-2022 走看看