請問Delphi6的TDBCtrlGrid的ScrollBar如何隱藏? |
答題得分者是:william
|
ying0515
中階會員 發表:90 回覆:168 積分:81 註冊:2003-01-04 發送簡訊給我 |
TDBCtrlGrid不管資料多寡,總是會顯示ScrollBar~~
請問要如何隱藏(去除)? TDBCtrlGrid無法實作
procedure Paint; override;
Compile出現
[Error] DBgridNoSc.pas(14): Method 'Paint' not found in base class
-------------------------------------------------------------------
unit DBgridNoSc;
interface
uses
Windows, Messages, SysUtils, Classes, Controls, dbcgrids;
type
TDBgridNoSc = class(TDBCtrlGrid)
private
{ Private declarations }
protected
{ Protected declarations }
procedure Paint; override;
public
{ Public declarations }
published
{ Published declarations }
end;
procedure Register;
implementation
procedure TDBgridNoSc.Paint;
begin
SetScrollRange(Self.Handle, SB_VERT, 0, 0, False);
inherited Paint;
end;
procedure Register;
begin
RegisterComponents('Samples', [TDBgridNoSc]);
end;
end. Delphi
------
Delphi |
william
版主 發表:66 回覆:2535 積分:3048 註冊:2002-07-11 發送簡訊給我 |
Not much experience with the TDBCtrlGrid, but I think you get the wrong way in overriding the "Paint" method:
unit DBgridNoSc; interface uses Windows, Messages, SysUtils, Classes, Controls, dbcgrids; type TDBgridNoSc = class(TDBCtrlGrid) private { Private declarations } protected { Protected declarations } procedure Paint(var Message: TWMPaint); message WM_PAINT; public { Public declarations } published { Published declarations } end; procedure Register; implementation procedure TDBgridNoSc.Paint(var Message: TWMPaint); begin SetScrollRange(Self.Handle, SB_VERT, 0, 0, False); inherited; end; procedure Register; begin RegisterComponents('Samples', [TDBgridNoSc]); end; end. |
ying0515
中階會員 發表:90 回覆:168 積分:81 註冊:2003-01-04 發送簡訊給我 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |