1.定义leftstr,midstr时需uses strutils.
2.打开记事本需要在單元接口部分引用 SHELLAPI單元
3.获取计算机名与IP时,需定义uses winsock;
4.试用sndplaysound,需定义mmsystem。
4、VCL组件中引用CxGrid导出Excel表格时可引用cxExportGrid4Link,
如:procedure TForm1.BitBtn3Click(Sender: TObject);
begin
if sdlgEXCEL.Execute then
begin
ExportGrid4ToEXCEL(sdlgEXCEL.FileName,cxGrid1,True,True);
end;
end;
5.常用类型定义:
var
NT:TNOTIFYICONDATA;
TNOTIFYICONDATA:系统托盘;
EnableMenuItem:修改菜单;
GetSystemMenu:获取系统菜单
6. 常用ascII值用法:
"+" if (Key in [$6B]) then
begin
RzMaskEdit1.Text:='0';
Abort;
end;
"-" if (Key in [$6D]) then
"*"
"/"
ESC键:关闭程序
procedure TEatForm.FormKeyPress(Sender: TObject; var Key: Char);
begin
if ord(key)=27 then
begin
close();
end;
end;
回车键:if ord(key)=13 then