Re: ScrollBar
- From: "FrancoJommi" <franco.jommi@xxxxxx>
- Date: Tue, 17 Jul 2007 22:01:04 +0200
I tried the following solution to my problem. I think it works, but I still
need to do some test. Particularly I don't know how to retrieve the number
of rows of the DBGrid so that I can suppress the vertical scroll bar when
possible only. Here is a sample of my test:
type
TForm1 = class(TForm)
DataSource1: TDataSource;
DBGrid1: TDBGrid;
Table1: TTable;
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
private
public
FScroll: TWndMethod;
procedure Scroll(var Msg: TMessage);
end;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
FScroll := DBGrid1.WindowProc; // metto da parte l'originale
DBGrid1.WindowProc := Scroll;
end;
procedure TForm1.FormDestroy(Sender: TObject);
begin
DBGrid1.WindowProc := FScroll; // reset
FScroll := nil;
end;
procedure TForm1.Scroll(var Msg: TMessage);
begin
// make the vertical scroll bar not visible
ShowScrollBar(DBGrid1.Handle, SB_VERT, False);
FScroll(Msg); // continua a fare i cavoli suoi
end;
end.
"Jamie" <jamie_ka1lpa_not_valid_after_ka1lpa_@xxxxxxxxxxx> ha scritto nel
messaggio news:PQ8mi.18$Mf7.16@xxxxxxxxxxxxxxx
FrancoJommi wrote:of
How do I hide the vertical ScrollBar in a DBGrid ? I tried "
ShowScrollBar(MyDBGrid.Handle, SB_BOTH, false);" but it doesn't work.
I thought I could get rid of the ScrollBar simply by setting the height
I itmy DBGrid to a value exceeding the max number of lines I will show, but
is not as I thought. Can you help ?Try Adjusting the ClientWidth and ClientHeigth of the DBgrid
reduce it down.
Normally the scrollbars are set to automatic if the client
is larger than the parent window the client sits in.
etc.
--
"I'm never wrong, once i thought i was, but was mistaken"
Real Programmers Do things like this.
http://webpages.charter.net/jamie_5
.
- Follow-Ups:
- Re: ScrollBar
- From: Jamie
- Re: ScrollBar
- References:
- ScrollBar
- From: FrancoJommi
- Re: ScrollBar
- From: Jamie
- ScrollBar
- Prev by Date: ~www.igsky.com~World Of Warcraft Online
- Next by Date: runescape,runescape gold,runescape money
- Previous by thread: Re: ScrollBar
- Next by thread: Re: ScrollBar
- Index(es):
Relevant Pages
|