2010-07-30 29 views

回答

2

将TTimer组件添加到窗体中,将其interval属性设置为1000(1秒)并处理OnTimer事件。到处理程序的代码把这个(假设你的文本框被命名为textBox1中):

textBox1.Text := textBox1.Text + 'N'; 
+1

这将是更有效的,无论是性能还是明智和内存明智,使用SelText属性而不是Text属性,即:' textBox1.SelStart:= textBox1.GetTextLen; textBox1.SelLength:= 0; textBox1.SelText:='N';' – 2010-07-31 00:42:26

+0

这是值得怀疑的,因为内部它必须连接字符串。而且,优化器应该很容易理解这种情况。 – 2010-07-31 11:38:09