c#编程字体改变不了
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 WindowsFormsApplication2 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void 字体ToolStripMenuItem_Click(object sender, EventArgs e) { RichTextBox richTextBox1 = new RichTextBox(); FontDialog fd = new FontDialog(); fd.Color =richTextBox1.ForeColor; fd.AllowScriptChange = true; fd.ShowColor = true; fd.AllowSimulations = true; fd.AllowVectorFonts = true; fd.FontMustExist = true; fd.MaxSize = 30; fd.MinSize = 6; fd.ShowApply = true; fd.ShowColor = true; fd.ShowEffects = true; if (fd.ShowDialog() != DialogResult.Cancel) { richTextBox1.SelectionFont = fd.Font; richTextBox1.SelectionColor = fd.Color; } } private void richTextBox1_TextChanged(object sender, EventArgs e) { } } } 字体框内输入字体不根据调整改变。
请你不要使用汉字的函数名和变量名 编译可能出问题
答:GreateGraphics没有找到 你需要引入对应的包详情>>