做软键盘的时候,下面是一个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;
解决方案 »
- 线程内存释放
- 求救,应该程序运行错误!
- 向流氓软件开火
- 如何实现文件的上传和下载?
- oracle字段类型char(1000),在dbgrid中显示不了,对应字段的列全都显示 (memo),有没有解决良策???
- 关于几个使用FTP控件Indy的问题
- [寻求好方法]共享函数\过程\等
- 怎样响应从外部拖动一文本块到某MEMO中。急急急!!!
- 怎么样可以获取本地TCP/IP配置
- 请问Delphi中有没有象c语言中的对二进制位操作?有没有用结构体定义一个整形的二进制位?
- 为什么用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的