Autor Beitrag
Siluro
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 74

Win XP Prof., Win XP64 Prof., Win 7 Prof.
Delphi 7 Ent., Delphi XE, Delphi XE5
BeitragVerfasst: Do 17.03.05 15:13 
Hi,
ich hab da mal ne Frage, gibt es die möglichkeit Informationen von der Scrollbar in einem Treeview zu erhalten?
Ich würde gerne Abfragen ob die Scrollbar aktiv bzw. vorhanden ist oder nicht.

Danke im Vorraus.

MfG

Björn
csa
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 22

Win XP
Delphi 2005 Prof.
BeitragVerfasst: Fr 18.03.05 18:32 
Hallo,

die entsprechenden Funktionen finden sich in der Hilfe zum Windows-SDK: EnableScrollBar, GetScrollPos, GetScrollInfo,...ShowScrollBar.

Wenn man die Quelltexte der VCL hat, kann man Beispiele in der Unit StdCtrls finden (TScrollBar), für GetScrollRange ein Beispiel in der Unit Grids.

Funktion zur Beantwortung der Frage, ob ein horizontaler Scrollbar existiert:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
// uses Windows, ...
...
function HScrollBarVisible(Handle: HWnd): Boolean;
var
  Min, Max: Integer;
begin
  Result := False;
  GetScrollRange(Handle, SB_HORZ, Min, Max);
  Result := not (Min = Max);
end;


dto. mit SB_VERT für den vertikalen ScrollBar.

Aufruf:
ausblenden Delphi-Quelltext
1:
  if HScrollBarVisible(TreeView1.Handle) then ...					


Gruß, Christoph
Siluro Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 74

Win XP Prof., Win XP64 Prof., Win 7 Prof.
Delphi 7 Ent., Delphi XE, Delphi XE5
BeitragVerfasst: Mo 21.03.05 11:09 
Danke