cbc KeyPress调用另外一个函数怎么不起作用阿
KeyPress调用另外一个函数怎么不起作用阿//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
void __fastcall TForm1::FormActivate(TObject *Sender)
{
edt1->SetFocus();
}
//-------------------------------------------------------------------------
void __fastcall TForm1::edt1KeyPress(TObject *Sender, char &Key)
{
if(Key==VK_RETURN)
edt2->SetFocus();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::edt2KeyPress(TObject *Sender, char &Key)
{
if(Key==VK_RETURN)
btn->SetFocus();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormPaint(TObject *Sender)
{
Canvas->TextOutA(10,20,edt1->Text);
Canvas->TextOutA(10,30,edt2->Text);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::btnKeyPress(TObject *Sender, char &Key)
{
if(Key==VK_RETURN)
{
FormPaint(Sender);
}
}
//---------------------------------------------------------------------------
结果还是原来的edt的text内容啊
为什么啊
怎么调用阿?