C#编程-134:字体颜色对话框_彭世瑜_新浪博客
彭世瑜 发布时间:2017-08-20 15:42:44 ,浏览量:1
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
-
- namespace ColorFontDialogTest
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
-
- private void btnBackColor_Click(object sender, EventArgs e)
- {
- if (colorDialog1.ShowDialog() == DialogResult.OK)
- {
- this.BackColor = colorDialog1.Color;
- }
- }
-
- private void btnFont_Click(object sender, EventArgs e)
- {
- if (fontDialog1.ShowDialog() == DialogResult.OK)
- {
- textBox1.Font = fontDialog1.Font;
- }
- }
-
- private void Form1_Load(object sender, EventArgs e)
- {
- textBox1.Text = "测试字体属性的文字,试试这段话的字体属性会不会被修改";
- }
- }
- }
1665367115
查看更多评论