DELPHI盒子
!实时搜索: 盒子论坛 | 注册用户 | 修改信息 | 退出
检举帖 | 全文检索 | 关闭广告 | 捐赠
技术论坛
 用户名
 密  码
自动登陆(30天有效)
忘了密码
≡技术区≡
DELPHI技术
lazarus/fpc/Free Pascal
移动应用开发
Web应用开发
数据库专区
报表专区
网络通讯
开源项目
论坛精华贴
≡发布区≡
发布代码
发布控件
文档资料
经典工具
≡事务区≡
网站意见
盒子之家
招聘应聘
信息交换
论坛信息
最新加入: laidabin
今日帖子: 3
在线用户: 18
导航: 论坛 -> DELPHI技术 斑竹:liumazi,sephil  
作者:
男 hamilton (老鼠爱大米) ★☆☆☆☆ -
普通会员
2003/5/23 10:23:25
标题:
怎么才能让DBGrid控件的内容跟着滚动条实时滚动? 浏览:2574
加入我的收藏
楼主: delphi的DBGid控件怎么没有类似PB的Livescroll属性,怎么才能在拖动滚动条时让它的内容也跟着实时滚动?

----------------------------------------------
-
作者:
男 boy (阿門) ★☆☆☆☆ -
盒子活跃会员
2003/5/23 15:13:17
1楼: 試試
unit dumy1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ComCtrls, DB, DBTables, Grids, DBGrids;

type
TDBGrid=class(DBGrids.TDBGrid)
public
function DoMouseWheel(Shift: TShiftState; WheelDelta: Integer; MousePos: TPoint): Boolean; override;
end;

TForm1 = class(TForm)
DBGrid1: TDBGrid;
Table1: TTable;
DataSource1: TDataSource;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation
{$R *.dfm}
{ TDBGrid }
function TDBGrid.DoMouseWheel(Shift: TShiftState; WheelDelta: Integer;MousePos: TPoint): Boolean;
begin
  if WheelDelta > 0 then
    datasource.DataSet.Next;
  if wheelDelta < 0 then
    DataSource.DataSet.Prior;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  table1.open;
end;

end.

----------------------------------------------
Delphi開發◆伺服器架設◆免安裝APACHE,PHP,CGI Perl, MYSQL ★
作者:
男 hamilton (老鼠爱大米) ★☆☆☆☆ -
普通会员
2003/5/24 15:29:00
2楼: 谢谢.不过没成功,可能使我没有表达清楚我的意图.我的意思是在用鼠标拖动DBGrid右侧的滑块的时候,让它的内容也跟着动,而不是像默认的状态那样等鼠标键抬起后才滚动内容.
----------------------------------------------
-
信息
登陆以后才能回复
Copyright © 2CCC.Com 盒子论坛 v3.0.1 版权所有 页面执行85.9375毫秒 RSS