delphi中的DBGRid鼠标滚动事件
Procedure OnMouseWheel(Var Msg :TMsg;var Handled:Boolean);
begin
if Msg.message = WM_MouseWheel then
begin
if Msg.wParam > 0 then
begin
if DBGrid.Focused then
begin
SendMessage(DBGrid1.Handle,WM_KEYDOWN,VK_UP,0);
end;
end
else
begin
if DBGrid.Focused then
SendMessage(DBGrid1.Handle,WM_KEYDOWN,VK_DOWN,0);
end;
Handled:= True;
end;
end;
需要在Form创建的时候写入
Application.OnMessage:=OnMouseWheel; // 截获鼠标滚动事件
相关文档:
使用delphi多年,前些天忽然遇到不会string转pbyte,很是失落,此时对于编程基本功的重要性深有体会.这其中用到MOVE函数.
搞了好一会才搞明白其用法.所以想贴出来帮助需要帮助的人.
var
s:string;
ps:Pchar;
b:pbyte;
len:integer;
begin
&nb ......
很奇怪,昨天在编译程序的时候,出现过,iphist.dat 文件。每次执行都出现,仔细查看代码,什么也没有啊!后来在网站找到原因:
使用了IPWatch 控件的
一般产生这个文件是因为使用了indy的 TIdIPWatch 控件
该控件有个
ip历史的功能。
historyfilename指定的是保存ip历史记录的文件名,默认是iphist.Dat
......
今天开始研究FastReport。
以下是动态创建FASTREPORT的DEMO
var
Page: TfrxReportPage;
Band: TfrxBand;
DataBand: TfrxMasterData;
Memo: TfrxMemoView;
begin
{ clear a report }
frxReport1.Clear;
{ add a dataset to the list of ones accessible for a report }
frxReport1.DataSets.Add(frxDB ......
DELPHI用得不太多,加上脑筋不好使,就记一下最常用对开发效率很有帮助的几个:
Ctrl+鼠标左键:查找定义
Ctrl+Shift+↑:上一操作与其正好相反,由定义查找实现
Ctrl+Shift+空格:在一个函数没有输入参数的括号内按下此快捷键时会出现函数相关参数的提示信息,包括重载的所有函数的信息 ......