管家婆打印颜色快递单:执行顺序问题???

来源:百度文库 编辑:高考问答 时间:2024/07/11 08:55:57
我用bcb6.0编程的.
我在keypress中有这样的代码;
void __fastcall TForm1::ComboBox1KeyPress(TObject *Sender, char &Key)
{AnsiString strInput;
strInput=ComboBox1->Text;
Edit1->Text=strInput;
}
在Edit1的Text显示的内容中是ComboBox1的Text的前一个.为什么?
但是我onchang事件不能满足我设计的全部要求的。所以我才用onkeypress的。

你将Edit->Text=ComboBox1->Text
写在ComboBox1的Change事件里面试试