Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何在 c# 中设置 TextBox 的字体大小。我可以获得当前大小,但不允许设置它。
public static Form client; ((TextBox)client.Controls[0]).Font.size = 16;
您必须设置Font属性。Size是 的只读属性Font。
Font
Size
var textBox = (TextBox)client.Controls[0]; textBox.Font = new Font(textBox.Font.FontFamily, 16);