private void textBox1_TextChanged(object sender, EventArgs e)
{
Size size = TextRenderer.MeasureText(textBox1.Text, textBox1.Font);
textBox1.Width = size.Width;
textBox1.Height = size.Height;
}
參考http://stackoverflow.com/questions/8048455/c-sharp-resize-textbox-to-fit-content
沒有留言:
張貼留言