I have a Textbox
and a Button
.
what I want is when I press the button textbox1.Text
should change it's font style.
How do I do that?
textBox1.Font = new Font(textBox1.Font, FontStyle.Regular);
参考:
http://social.msdn.microsoft.com/Forums/en-US/netfxbcl/thread/696f80d0-8799-404e-9933-90991c697708/
textBox1.Font = new Font(textBox1.Font, FontStyle.Regular);
你的 button_click 事件
private void button1_Click(object sender, EventArgs e)
{
Font myfont = new Font("Times New Roman", 12.0f);
Textbox1.Font = myfont;
}