做软键盘的时候,下面是一个action事件,每个按扭的action被赋值这个事件,报错为:Invaled class typecast而且我更改SpeedButton的caption属性后,还是显示为Action里的captionprocedure TFrmLogin.AddKeyExecute(Sender: TObject);
begin
if uid.Focused then
uid.Text := uid.Text + (Sender as TSpeedButton).Caption;
if pwd.Focused then
pwd.Text := pwd.Text + (Sender as TSpeedButton).Caption;
end;
begin
if uid.Focused then
uid.Text := uid.Text + (Sender as TSpeedButton).Caption;
if pwd.Focused then
pwd.Text := pwd.Text + (Sender as TSpeedButton).Caption;
end;
解决方案 »
- 顶你们个肺啊,都当爹了!!来接分吧!!
- delphi程序员的价值在于享受生活(不好意思没分给就只有100分)
- 请问如何将(金额)float型的数据,全部用四舍五入法保留两位小数点后插入另一个表?
- 日期函数的问题
- 关于网上邻居,急!!!
- 高分求助,大侠,帮忙看一下这段代码,执行时总出错。
- 求助高手用delphi6实现点对点文件传输
- 如何在DELPHI程序中加入背景音乐
- 300分求MD5算法源码和解密算法
- 各位老大:听说宝兰有一个查看是否用宝兰工具编的程序,不只知叫甚么,宝兰网上哪里有,谢了!!
- 为什么用IdTcpClient发送16进制流数据,接收不到数据?
- Fastreport 2.4 和 fastreport 3.07 onManualBuild事件差别
//这里的Sender传近来的应该是TAction
begin
if uid.Focused then
uid.Text := uid.Text + (Sender as TAction).Caption; //这样试试!
if pwd.Focused then
pwd.Text := pwd.Text + (Sender as TAction).Caption;
end;还有你设置了TSpeedButton之后,再去设置Action,他会用Action对应的一些相关属性来更改
TSpeedButton的