mainform.cs
来自「《Windows Mobile平台应用与开发》源码」· CS 代码 · 共 34 行
CS
34 行
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 + =
减小字号Ctrl + -
显示快捷键?