版块导航
正在加载中...
客户端APP下载
登录
注册
帖子
帖子
用户
本版
应《网络安全法》要求,自2017年10月1日起,未进行实名认证将不得使用互联网跟帖服务。为保障您的帐号能够正常使用,请尽快对帐号进行手机号验证,感谢您的理解与支持!
24小时热门版块排行榜
>
虫友互识
(5954)
>
论坛更新日志
(4558)
>
留学DIY
(3104)
>
留学生活
(2463)
>
海外博后
(1512)
>
育儿交流
(1202)
>
医药类考试
(1001)
>
海归之家
(1000)
>
材料综合
(799)
>
人文社科
(798)
>
信息科学
(760)
>
复合材料
(658)
>
地学
(640)
>
分子模拟
(601)
>
文学芳草园
(601)
>
转基因
(600)
小木虫论坛-学术科研互动平台
»
计算模拟区
»
程序语言
»
Delphi&Pascal
»
【转帖】Delphi2010软键盘(TTouchKeyboard)用法示例
2
1/1
返回列表
查看: 1644 | 回复: 1
只看楼主
@他人
存档
新回复提醒
(忽略)
收藏
在APP中查看
zyj8119
木虫
(著名写手)
应助: 65
(初中生)
贵宾: 0.003
金币: 915.1
散金: 1440
红花: 35
帖子: 2936
在线: 1329.4小时
虫号: 664177
注册: 2008-11-29
性别: GG
专业: 理论和计算化学
[交流]
【转帖】Delphi2010软键盘(TTouchKeyboard)用法示例
已有1人参与
代码文件:
CODE:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Keyboard, TeCanvas;
type
TForm1 = class(TForm)
TouchKeyboard1: TTouchKeyboard;
Edit1: TEdit;
Memo1: TMemo;
CheckBox1: TCheckBox;
CheckBox2: TCheckBox;
CheckBox3: TCheckBox;
ButtonColor1: TButtonColor;
ButtonColor2: TButtonColor;
procedure FormCreate(Sender: TObject);
procedure CheckBox1Click(Sender: TObject);
procedure CheckBox2Click(Sender: TObject);
procedure CheckBox3Click(Sender: TObject);
procedure ButtonColor1Click(Sender: TObject);
procedure ButtonColor2Click(Sender: TObject);
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
//是否要背景
procedure TForm1.CheckBox1Click(Sender: TObject);
begin
case CheckBox1.Checked of
True: TouchKeyboard1.DrawingStyle := TCustomTouchKeyboard.TDrawingStyle.dsGradient;
False: TouchKeyboard1.DrawingStyle := TCustomTouchKeyboard.TDrawingStyle.dsNormal;
end; {注意 TDrawingStyle 类型是定义在 TCustomTouchKeyboard 内部的}
case CheckBox1.Checked of
True: CheckBox1.Caption := 'DrawingStyle := dsGradient';
False: CheckBox1.Caption := 'DrawingStyle := dsNormal';
end;
end;
//背景过渡色 - 起始色
procedure TForm1.ButtonColor1Click(Sender: TObject);
begin
TouchKeyboard1.GradientStart := TButtonColor(Sender).SymbolColor;
end;
//背景过渡色 - 终止色
procedure TForm1.ButtonColor2Click(Sender: TObject);
begin
TouchKeyboard1.GradientEnd := TButtonColor(Sender).SymbolColor;
end;
//大小键盘切换
procedure TForm1.CheckBox2Click(Sender: TObject);
begin
case CheckBox2.Checked of
True: begin
TouchKeyboard1.Layout := 'NumPad';
TouchKeyboard1.Width := 180;
TouchKeyboard1.Height := 150;
CheckBox2.Caption := 'Layout := NumPad';
end;
False: begin
TouchKeyboard1.Layout := 'Standard';
TouchKeyboard1.Width := 550;
TouchKeyboard1.Height := 180;
CheckBox2.Caption := 'Layout := Standard';
end; {注意: 这里的 Layout 属性是个字符串}
end;
end;
//更换键名显示, 这在设计时通过 KeyCaptions 属性调整更方便
procedure TForm1.CheckBox3Click(Sender: TObject);
begin
case CheckBox3.Checked of
True: begin
TouchKeyboard1.CaptionOverrides.SetCaption('Esc', '退出');
TouchKeyboard1.CaptionOverrides.SetCaption('Backspace', '退格');
TouchKeyboard1.CaptionOverrides.SetCaption('Del', '删除');
TouchKeyboard1.CaptionOverrides.SetCaption('Enter', '回车');
{Esc Backspace Tab Del Caps Enter LeftShift RightShift LeftCtrl LeftAlt RightAlt RightCtrl}
end;
False: TouchKeyboard1.CaptionOverrides.Clear;
end;
TouchKeyboard1.Redraw; {重绘}
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
Memo1.Font.Color := clBlue;
Memo1.Font.Size := 12;
Memo1.ScrollBars := ssBoth;
Edit1.Font.Color := clRed;
Edit1.Font.Size := 12;
CheckBox1.Caption := '背景色';
CheckBox2.Caption := '大小键盘切换';
CheckBox3.Caption := '功能键重命名';
end;
end.
窗体文件:
object Form1: TForm1
Left = 0
Top = 0
Caption = 'Form1'
ClientHeight = 336
ClientWidth = 566
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
OldCreateOrder = False
OnCreate = FormCreate
PixelsPerInch = 96
TextHeight = 13
object TouchKeyboard1: TTouchKeyboard
Left = 8
Top = 148
Width = 550
Height = 180
GradientEnd = clSilver
GradientStart = clGray
Layout = 'Standard'
end
object Memo1: TMemo
Left = 8
Top = 43
Width = 297
Height = 99
Lines.Strings = (
'Memo1')
TabOrder = 1
end
object Edit1: TEdit
Left = 8
Top = 8
Width = 297
Height = 21
TabOrder = 2
Text = 'Edit1'
end
object ButtonColor1: TButtonColor
Left = 327
Top = 43
Width = 102
Caption = 'ButtonColor1'
TabOrder = 3
OnClick = ButtonColor1Click
end
object ButtonColor2: TButtonColor
Left = 448
Top = 43
Width = 102
Caption = 'ButtonColor2'
TabOrder = 4
OnClick = ButtonColor2Click
end
object CheckBox1: TCheckBox
Left = 327
Top = 10
Width = 223
Height = 17
Caption = 'CheckBox1'
TabOrder = 5
OnClick = CheckBox1Click
end
object CheckBox2: TCheckBox
Left = 327
Top = 88
Width = 194
Height = 17
Caption = 'CheckBox2'
TabOrder = 6
OnClick = CheckBox2Click
end
object CheckBox3: TCheckBox
Left = 327
Top = 111
Width = 194
Height = 17
Caption = 'CheckBox3'
TabOrder = 7
OnClick = CheckBox3Click
end
end
回复此楼
» 猜你喜欢
有时候,自然基金真的不能太认真 (我的申报经验)
已经有11人回复
欢迎发来filecode的Mz6后的代码验证其规律
已经有68人回复
时间戳又变了8-15
已经有23人回复
filecode=后面第一个是大写字母
已经有7人回复
filecode
已经有12人回复
小木虫上这么多卖论文的,真有人买论文么?感觉没必要啊
已经有13人回复
哪位老哥知道今年的国自然具体哪一天放榜?
已经有7人回复
关于Filecode分析方法
已经有13人回复
各位道友,我要去昆明玩几天,回来见。
已经有8人回复
咱们一起用铁证分析2026国家社科基金中标与否
已经有22人回复
高级回复
好好学习,天天向上。
1楼
2010-12-02 15:37:40
已阅
回复此楼
关注TA
给TA发消息
送TA红花
TA的回帖
wd0001
新虫
(小有名气)
应助: 0
(幼儿园)
金币: 500.7
红花: 1
帖子: 107
在线: 23.8小时
虫号: 2930821
注册: 2014-01-14
专业: 核技术及其应用
★
小木虫: 金币+0.5, 给个红包,谢谢回帖
好高端大气上档次的样子
赞
一下
回复此楼
高级回复
2楼
2014-02-21 22:07:49
已阅
回复此楼
关注TA
给TA发消息
送TA红花
TA的回帖
相关版块跳转
第一性原理
量子化学
计算模拟
分子模拟
仿真模拟
程序语言
我要订阅楼主
zyj8119
的主题更新
2
1/1
返回列表
如果回帖内容含有宣传信息,请如实选中。否则帐号将被全论坛禁言
普通表情
龙
兔
虎
猫
高级回复
(可上传附件)
百度网盘
|
360云盘
|
千易网盘
|
华为网盘
在新窗口页面中打开自己喜欢的网盘网站,将文件上传后,然后将下载链接复制到帖子内容中就可以了。
最具人气热帖推荐
[查看全部]
作者
回/看
最后发表
[
基金申请
]
欢迎发来filecode的Mz6后的代码验证其规律
+31
医学老男孩
2026-08-13
68/3400
2026-08-15 23:19
by
医学老男孩
[
基金申请
]
filecode=后面第一个是大写字母
+6
wangze12014
2026-08-14
7/350
2026-08-15 20:12
by
gltch
[
基金申请
]
小木虫上这么多卖论文的,真有人买论文么?感觉没必要啊
+12
Tide man
2026-08-10
13/650
2026-08-15 16:34
by
氺木
[
基金申请
]
关于Filecode分析方法
+10
majunge000
2026-08-10
13/650
2026-08-15 12:26
by
hanpeng972
[
基金申请
]
各位道友,我要去昆明玩几天,回来见。
+7
Tide man
2026-08-14
8/400
2026-08-15 01:11
by
arzu_hma
[
基金申请
]
是这周出结果还是下周出结果?
+4
yuleib84
2026-08-11
4/200
2026-08-14 23:05
by
lfy8008
[
基金申请
]
奇怪,两个人的filecode固定段从头到尾一模一样
+8
布布和一二
2026-08-10
11/550
2026-08-14 14:58
by
Equinoxhua
[
硕博家园
]
请教兼职经验
+3
是阿文鸭
2026-08-09
3/150
2026-08-14 12:07
by
HER12025
[
硕博家园
]
读博的好处
+4
lnee
2026-08-11
4/200
2026-08-14 10:20
by
ahsoarli
[
基金申请
]
FileCode能看出啥?
+10
要乐观耀哥
2026-08-10
32/1600
2026-08-14 09:37
by
要乐观耀哥
[
基金申请
]
我的国基提前知道中了,可是同事的操作让我实在接受不了,怎么会有这样的人
+10
家与远方
2026-08-10
15/750
2026-08-14 02:08
by
绵羊哥哥
[
文学芳草园
]
阿姨
+4
汪汪锅
2026-08-09
4/200
2026-08-13 19:43
by
arzu_hma
[
基金申请
]
不应该看fileCode
+7
且听虎啸
2026-08-12
9/450
2026-08-13 14:27
by
flydreamws
[
基金申请
]
Filecode 又变了,巨变
+3
WH3796
2026-08-12
4/200
2026-08-13 14:13
by
小木虫6752397
[
基金申请
]
结合人工智能,周易传统文化,filecode打分制来了,3分以上希望很大。
+3
Tide man
2026-08-12
4/200
2026-08-13 08:35
by
ZJTJZ
[
基金申请
]
2019年青年基金涵评意见,大家看看几个A,几个B?
+11
Tide man
2026-08-11
11/550
2026-08-13 07:35
by
撸猫猫
[
基金申请
]
综述论文作为代表作会不会影响评审专家的印象分?
+11
yufeiwaner
2026-08-09
13/650
2026-08-12 08:17
by
yufeiwaner
[
基金申请
]
确定了,国自然21号放榜
+6
布布和一二
2026-08-10
7/350
2026-08-10 19:15
by
2000zf36392
[
基金申请
]
国自然结果
+4
Vierhys
2026-08-10
8/400
2026-08-10 15:06
by
Vierhys
[
基金申请
]
面上项目filecode邪修
+5
西山十月
2026-08-09
7/350
2026-08-10 07:32
by
仁砚薪传
信息提示
关闭
请填处理意见
关闭
确定