New Tip - ...show proportional thumbs in a TScrollbar/TStringGrid ?

  • From: "SwissDelphiCenter.ch" <newsletter@xxxxxxxxxxxxxxxxxxxx>
  • To: sdcnewtip@xxxxxxxxxxxxx
  • Date: Fri, 8 Mar 2002 08:53:12 +0100

* SwissDelphiCenter new Tip newsletter
* www.swissdelphicenter.ch
*
* To unsubscribe send a mail to sdcnewtip-request@xxxxxxxxxxxxx with the
* subject unsubscribe


Hallo,

Folgender neuer Tip ist neu auf SwissDelphiCenter verfügbar:

Besuchen Sie die Programmier Tips unter 
http://www.swissdelphicenter.ch/de/tipsindex.php


Bewerten Sie diesen Tip nach Schwierigkeitsgrad, Nützlichkeit und Gesamthaft auf
http://www.swissdelphicenter.ch/de/showcode.php?id=1052



Autor:
P. Below <>
http://www.teamb.com


-------------
...proportionale Rollboxen in einer TScrollbar/TStringGrid anzeigen ?
-------------
Kategorie: VCL



// Getting a TScrollbar control to Show a proportional thumb:

procedure TForm1.Button1Click(Sender: TObject);
var
  info: TScrollInfo;
begin
  FillChar(info, SizeOf(info), 0);
  with info do
  begin
    cbsize := SizeOf(info);
    fmask  := SIF_PAGE;
    nPage  := ScrollBar1.LargeChange;
  end;
  SetScrollInfo(ScrollBar1.Handle, SB_CTL, info, True);
end;

// Same for a TStringGrid

procedure TForm1.Button1Click(Sender: TObject);
var
  info: TScrollInfo;
begin
  FillChar(info, SizeOf(info), 0);
  with info do
  begin
    cbsize := SizeOf(info);
    fmask  := SIF_ALL;
    GetScrollInfo(StringGrid1.Handle, SB_VERT, info);
    fmask := fmask or SIF_PAGE;
    nPage := 5 * (nmax - nmin) div StringGrid1.RowCount;
    // whatever number of cells you consider a "page"
  end;
  SetScrollInfo(StringGrid1.Handle, SB_VERT, info, True);
end;




Best Regards
SwissDelphiCenter Team
www.swissdelphicenter.ch
[automatisch generierte EMail]


----------------------------------------------------
ENGLISH NEWSLETTER
----------------------------------------------------

Hi,

This new tip is new available on SwissDelphiCenter.ch:

Visit the programming tips at http://www.swissdelphicenter.ch/en/tipsindex.php


Rate this tip after skill, useful and overall at
http://www.swissdelphicenter.ch/en/showcode.php?id=1052



Author:
P. Below <>
http://www.teamb.com


-------------
...show proportional thumbs in a TScrollbar/TStringGrid ?
-------------
Category: VCL



// Getting a TScrollbar control to Show a proportional thumb:

procedure TForm1.Button1Click(Sender: TObject);
var
  info: TScrollInfo;
begin
  FillChar(info, SizeOf(info), 0);
  with info do
  begin
    cbsize := SizeOf(info);
    fmask  := SIF_PAGE;
    nPage  := ScrollBar1.LargeChange;
  end;
  SetScrollInfo(ScrollBar1.Handle, SB_CTL, info, True);
end;

// Same for a TStringGrid

procedure TForm1.Button1Click(Sender: TObject);
var
  info: TScrollInfo;
begin
  FillChar(info, SizeOf(info), 0);
  with info do
  begin
    cbsize := SizeOf(info);
    fmask  := SIF_ALL;
    GetScrollInfo(StringGrid1.Handle, SB_VERT, info);
    fmask := fmask or SIF_PAGE;
    nPage := 5 * (nmax - nmin) div StringGrid1.RowCount;
    // whatever number of cells you consider a "page"
  end;
  SetScrollInfo(StringGrid1.Handle, SB_VERT, info, True);
end;



Best Regards
SwissDelphiCenter Team
www.swissdelphicenter.ch
[automatic generated EMail]

Other related posts:

  • » New Tip - ...show proportional thumbs in a TScrollbar/TStringGrid ?