-1

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?

4

3 回答 3

2
textBox1.Font = new Font(textBox1.Font, FontStyle.Regular);

参考:

http://social.msdn.microsoft.com/Forums/en-US/netfxbcl/thread/696f80d0-8799-404e-9933-90991c697708/

于 2013-05-23T06:29:35.327 回答
1
textBox1.Font = new Font(textBox1.Font, FontStyle.Regular);
于 2013-05-23T06:29:03.537 回答
1

你的 button_click 事件

private void button1_Click(object sender, EventArgs e)
{
   Font myfont = new Font("Times New Roman", 12.0f); 
   Textbox1.Font = myfont;
}
于 2013-05-23T06:36:41.483 回答