首页 > 其他 > 详细

当你刷新当前Table时,刷新后如何回到你上一次所在位置呢?

时间:2015-12-11 13:09:04      阅读:156      评论:0      收藏:0      [点我收藏+]

第一:

在你刷新前保存所在位置的行号

procedure XXXClass.LockPositionEx;
begin
DisableControls;

FHistoryRecNo := 0;
FHistoryIndexName := EmptyStr;
if Active then
begin
if IndexName <> EmptyStr then
FHistoryIndexName := IndexName;
IndexName := EmptyStr;

if not IsEmpty then
if (State in [dsEdit,dsInsert]) then
FHistoryRecNo := -1
else
FHistoryRecNo := RecNo;
end;
end;

第二刷新后定位到新行号


procedure XXXClass.UnlockPositionEx;
begin
if Active then
begin
if not IsEmpty then
if FHistoryRecNo < 0 then//处理编辑状态,直接跳至最后一条记录
Last
else if FHistoryRecNo = 0 then
First
else if FHistoryRecNo > 0 then//
begin
if RecordCount >= FHistoryRecNo then
RecNo := FHistoryRecNo
else if RecordCount > 0 then
Last;
end;

if FHistoryIndexName <> EmptyStr then
begin
IndexName := FHistoryIndexName;
FHistoryIndexName := EmptyStr;
end;
end;

EnableControls;
end;

 

当你刷新当前Table时,刷新后如何回到你上一次所在位置呢?

原文:http://www.cnblogs.com/Morlin-julier/p/5038627.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!