Re: ScrollBar
- From: Jamie <jamie_ka1lpa_not_valid_after_ka1lpa_@xxxxxxxxxxx>
- Date: Wed, 18 Jul 2007 17:55:31 -0400
FrancoJommi wrote:
I tried the following solution to my problem. I think it works, but I stillYes, that is one way of doing it.
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:
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
of
my DBGrid to a value exceeding the max number of lines I will show, but
I it
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
if it works for you, then you're all set..
--
"I'm never wrong, once i thought i was, but was mistaken"
Real Programmers Do things like this.
http://webpages.charter.net/jamie_5
.
- References:
- ScrollBar
- From: FrancoJommi
- Re: ScrollBar
- From: Jamie
- Re: ScrollBar
- From: FrancoJommi
- ScrollBar
- Prev by Date: runescape,runescape gold,runescape money
- Next by Date: www.runescape-money.eu buy cheap runescape gold and runescape money
- Previous by thread: Re: ScrollBar
- Next by thread: www.rstou.com(Runescape),best?batter?
- Index(es):
Relevant Pages
|