标题:KeyPress调用另外一个函数怎么不起作用阿
只看楼主
wfjt
Rank: 1
等 级:新手上路
帖 子:121
专家分:0
注 册:2007-11-30
 问题点数:0 回复次数:0 
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内容啊
为什么啊
怎么调用阿?
搜索更多相关主题的帖子: KeyPress 函数 
2008-05-14 10:42



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-214208-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.387066 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved