📄 mainform.cs
字号:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace UsingFont
{
public partial class MainForm : Form
{
public MainForm()
{
InitializeComponent();
}
private void MainForm_Paint(object sender, PaintEventArgs e)
{
// 用明确的字体族名字构造一个字体,大小为25点,使用粗斜体样式
Font f = new Font("Arial", 25.0f, FontStyle.Bold | FontStyle.Italic);
// 构造一个绿色的实心画刷
SolidBrush b = new SolidBrush(Color.Green);
// 在屏幕上绘制字符串,左上角坐标为(20,20)
e.Graphics.DrawString("Mobile", f, b, 20, 20);
// 释放画刷和字体
b.Dispose();
f.Dispose();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -