-
Delphi 如何定义自已的鼠标单击事件
Delphi 如何定义自已的鼠标单击事件,本程序定义了监测鼠标中轮的事件,当用户按下鼠标中轮时,将监测到运作类型,并弹出窗口返回结果。
- 2022-05-13 22:55:23下载
- 积分:1
-
获取windows System目录路径-Delphi示例
Delphi获取windows System目录路径,这个比较简单,觉得没啥用,只是可以练习一下GetSystemDirectory函数如何使用,下面分享出核心的代码,完整代码需要您下载哦:
begin
GetMem(SysDir,255);
GetSystemDirectory(SysDir,255);
Edit1.Text := SysDir;
end;
- 2022-03-18 16:21:27下载
- 积分:1
-
Delphi 单击StringGrid列进行排序
Delphi 单击StringGrid列进行排序,StringGrid行的任意列单击,就会重新排序一次,排序规则可以自己定义,这种排序功能可有效提升StringGrid显示数据的易用性,增强其功能,提升用户体验,本例子源代码相当简单,对学习者也有很好的帮助作用。参见以下代码:
begin
if Button = mbRight then Exit;
TStringGrid(Sender).MouseToCell(X, Y, vCol, vRow);
if (vRow < 0) or (vRow >= TStringGrid(Sender).FixedRows) then Exit;
StringGridRowSort(TStringGrid(Sender), vCol, vOldCol = vCol);
if vOldCol = vCol then
vOldCol := - vOldCol
else
vOldCol := vCol;
end;
- 2022-05-29 23:30:47下载
- 积分:1
-
Delphi 得到 Windows当前时间的例子
Delphi 获取并显示当前Windows时间的例子,这个例子比较简单了,程序就完成一项功能,打开窗口后,点击按钮,即可获取当前的系统时间,并显示在窗体上,如效果图所示。
- 2022-06-29 06:02:41下载
- 积分:1
-
Delphi7 获取文件的修改时间
Delphi7 获取文件的修改时间,这是一个文件操作实例源代码,获取到文件被修改的时间,代码简单,适合Delphi新手学习参考。
- 2022-03-25 03:51:22下载
- 积分:1
-
Delphi 使用tfilestream方式复制文件
Delphi 使用tfilestream方式复制文件,你可参考本源码,学习一下OpenDialog、Tfilestream.Create、showmessage、CopyFile的用法,本实例复制文件,是通过读取文件流,保存文件流的方式复制,并不是使用命令复制文件。
- 2022-01-21 03:12:02下载
- 积分:1
-
Delphi 将字符串中的任意字符转换成大写
Delphi 将字符串中的任意字符转换成大写,可将给定一串字符中指定的字符转换成大写,如示例运行效果所示,将字符串中的所有l字符变成大写的L。
- 2022-04-23 13:34:26下载
- 积分:1
-
Delphi 简单获取Windows时间的例子
简单获取Windows时间-Delphi源代码,改时间的小程序,在Windows自带的时间管理中也可完成系统时间的修改,这个只是一个帮助了解Windows与Delphi编程的例子,如何通过Delphi的程序来修改Windows时间,大致就是这样实现的。可参见以下源码:
procedure TForm1.Button1Click(Sender: TObject);
var
Dtimer : TSystemTime;
hh,Ghh : Integer;
begin
hh := StrToInt(Trim(Edit4.Text));
if hh < 8 then
Ghh := 16 + hh
else
Ghh := hh - 8;
with Dtimer do
begin
wYear:=StrToInt(Edit1.Text);
wMonth:=StrToInt(Edit2.Text);
wDay:=StrToInt(Edit3.Text);
wHour:=Ghh;
wMinute:=StrToInt(Edit5.Text);
wSecond:=StrToInt(Edit6.Text);
end;
SetSystemTime(Dtimer);
end;
- 2022-07-09 18:55:23下载
- 积分:1
-
Delphi 变速齿轮# 让时间变快减慢
Delphi 变速齿轮# 让时间变快减慢,其实这个似乎是做不到的,只是模拟一下,代码及描述如下:
procedure Speed(count:word); stdcall;
const ExceptionUsed = $03; { 中断号也可以用其它的中断号}
var
IDT : array [0..5] of byte; { 保存中断描述符表}
lpOldGate : dword; {存放旧向量}
begin
asm
push ebx
sidt IDT {读入中断描述符表}
mov ebx, dword ptr [IDT+2]{IDT表基地址}
add ebx, 8*ExceptionUsed {计算中断在中断描述符表中的位置}
cli {关中断}
mov dx, word ptr [ebx+6] {取6,7字节 另外4字节用于门属性和选择子 }
shl edx, 16d {左移16位}
mov dx, word ptr [ebx] {取1,2字节 }
mov [lpOldGate], edx {保存旧的中断门}
mov eax, offset @@Ring0Code {修改向量,指向Ring0级代码段}
mov word ptr [ebx], ax {低16位,保存到1,2字}
shr eax, 16d
mov word ptr [ebx+6], ax {高16位,保存到6,7位}
int ExceptionUsed {发生中断}
mov ebx, dword ptr [IDT+2] {重新定位到中断描述符表中}
add ebx, 8*ExceptionUsed
mov edx, [lpOldGate]
mov word ptr [ebx], dx
- 2023-02-13 04:55:03下载
- 积分:1
-
Delphi 打印图形(图片)
Delphi 打印图形,把图片打印出来,通过这个例子,你可以学习到:
strect:Trect;//定义打印输出矩形框的大小
temhi,temwd:integer;
begin
if DIGPrint.execute then
begin
temhi:=imgpic.picture.height;
temwd:=imgpic.picture.width;
while (temhi = printer.pageheight div 2)and
//将图形放大到打印页面的1/2大小
(temwd = printer.pagewidth div 2) do
begin
temhi:=temhi+temhi;
temwd:=temwd+temwd;
end;
with strect do //定义图形在页面上的中心位置输出
begin
left := (printer.pagewidth -temwd) div 2;
top := (printer.pageheight-temhi) div 2;
right := left+temwd;
bottom := top+temhi;
end;
with printer do
begin
begindoc;
canvas.stretchdraw(strect,imgpic.picture.graphic);
enddoc;
end;
end;
- 2022-10-24 23:35:04下载
- 积分:1