110,025
社区成员




// 该例子要添加一个文本框,并双击生成textBox1_TextChanged响应函数
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
using (Graphics g = this.CreateGraphics())
using (Bitmap tmp = new Bitmap( textBox1.Width, textBox1.Height ) )
{
textBox1.DrawToBitmap(tmp, new Rectangle(0, 0, tmp.Width, tmp.Height));
g.DrawImageUnscaled(tmp, 10, 10);
}
}
}
// 该例子要添加一个文本框,并双击生成textBox1_TextChanged响应函数
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
using (Graphics g = this.CreateGraphics())
using (Bitmap tmp = new Bitmap( textBox1.Width, textBox1.Height ) )
{
textBox1.DrawToBitmap(tmp, new Rectangle(0, 0, tmp.Width, tmp.Height));
g.DrawImageUnscaled(tmp, 10, 10);
}
}
}