C#设置字体大小和颜色

        public Form1()
        {
            InitializeComponent();
            label1.Font = new Font("隶书", 20, FontStyle.Bold); //第一个是字体,第二个大小,第三个是样式,
            label1.ForeColor = Color.Red; //颜色 

            label2.Font = new Font("华文行楷", 20, FontStyle.Bold); //第一个是字体,第二个大小,第三个是样式,
            label2.ForeColor = Color.Green; //颜色

            label3.Font = new Font("宋体", 20, FontStyle.Bold); //第一个是字体,第二个大小,第三个是样式,
            label3.ForeColor = Color.Blue; //颜色
            label3.Text = DateTime.Now.ToString("yyyy-MM-dd");
        }
时间: 2024-07-29 07:37:54

C#设置字体大小和颜色的相关文章

linux的链接工具secure设置字体大小和颜色

TextView字体大小及颜色设置

TextView设置文字大小及颜色: 1.1)通过xml配置 <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:textColor="#FF0000" android:textSize="18sp"/> 1.2)通过代码设置(方式一) TextView textView = new T

UITabBar,UITabBarItem怎么用字典设置UITabBarItem字体大小和颜色,保持原图颜色(item5)

#import "ViewController.h" @interface ViewController () @end @implementation ViewController - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. // 设置屏幕背景色 self.view.backgroundColor

修改 android ListView 字体大小及颜色

android中ListView的默认字体有时会满足不了设计的需求,需要设计自己的风格, 一般网上介绍的是新建一个自己的 ListView的适配器MyAdapter,现有另一种方法可避免新建MyAdapter的麻烦. 1.在res/layout/下新建 array_adapter.xml : 1 <?xml version="1.0" encoding="utf-8"?> 2 <TextView xmlns:android="http:/

PowerDesinger15设置字体大小

使用PowerDesigner时,它默认table的字体大小颜色等非常难看: 如果通过 Symbol ---> Format进行设置,只能对选中的最修改,新建的Table无效. 可以通过如下修改,让你的设置永久保存: Tools -----> Display Preference.... ------> Format ------> Table -----> Modify ------> Font 然后对所有值做修改(建议字体大小都是12,颜色蓝色最好,主键为红色,外键

jQuery实现设置字体大小代码实例

jQuery实现设置字体大小代码实例:设置网页中字体的大小是常见的操作,下面就通过代码实例介绍一下如何实现此功能.代码如下: <!DOCTYPE html> <html> <head> <meta charset=" utf-8"> <meta name="author" content="http://www.softwhy.com/" /> <title>蚂蚁部落<

Android Studio升级到0.8.1后怎样设置字体大小?

升级到0.8.1后.打开设置字体大小页面.你会发现无论是Default还是Darcula,都不同意你改变字体的大小.事实上这个是由于这两个模式是Android Studio自带模式,所以不同意你修改,你要改的话要自己定义自己的模式.例如以下图: 选中一个你想要的样式,然后点击Save as,然后在弹出的对话框中输入你自定义的样式的名称. 然后再把Scheme name选择成你自己定义的样式,这个时候就能够改了.

Android Studio设置字体大小

设置字体大小,如图设置即可: 1.点击进入设置 2.注意在图标识2的位置,会让你写一个自己定义的名字,然后保存即可(就是相当于自己以后用的),3的位置也就是你定义的文字大小了.

android TextView 设置字体大小

package com.example.yanlei.yl4; import android.graphics.Color;import android.os.Bundle;import android.support.v7.app.AppCompatActivity;import android.text.Spannable;import android.text.style.AbsoluteSizeSpan;import android.text.style.BackgroundColorS