Autor Beitrag
SAiBOT
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 323
Erhaltene Danke: 6

XP SP2; 7
D7; D2009
BeitragVerfasst: Sa 02.01.10 13:35 
Hallo, ich habe eine eigene Komponente von der TStringGrid abgeleitet und diese mit Informationen gefüllt. Sie hat jetzt etwa 50 Rows und mein Bildschirm zeigt bis auf 3 Rows alle an, dabei ist der "verschiebe-Button" der Scrollbar ganz winzig. Die Scrollbar lässt sich mit den Pfeilbuttons auch nur zwei mal verschieben hat also drei Positionen (oben, mitte, unten). Es wäre schöner wenn meine Komponente die Scrollbar so formt und händelt wie es beispielsweise eine Listbox tut. Kann ich das irgendwie bewerkstelligen?

_________________
Debuggers don't remove bugs, they only show them in slow-motion.
Lannes
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2352
Erhaltene Danke: 4

Win XP, 95, 3.11, IE6
D3 Prof, D4 Standard, D2005 PE, TurboDelphi, Lazarus, D2010
BeitragVerfasst: Sa 02.01.10 13:46 

_________________
MfG Lannes
(Nichts ist nicht Nichts) and ('' <> nil ) and (Pointer('') = nil ) and (@('') <> nil )
SAiBOT Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 323
Erhaltene Danke: 6

XP SP2; 7
D7; D2009
BeitragVerfasst: Sa 02.01.10 17:17 
Funktioniert bis auf eine Sache ganz gut:
Wenn ich ganz runter Scroll bleiben ein paar Rows aus (als wenn nicht ganz runter gescrollt wurde) , wenn ich jedoch mit den Pfeilbuttons ganz noch unten scrolle werden auch die letzten Rows angezeigt. Wie kann ich das umgehen?

_________________
Debuggers don't remove bugs, they only show them in slow-motion.
SAiBOT Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 323
Erhaltene Danke: 6

XP SP2; 7
D7; D2009
BeitragVerfasst: So 03.01.10 14:38 
Habe es geschafft:

ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
procedure TMyGrid.OnScroll(var Msg: TMessage);
var
  info: TScrollInfo;
begin
  inherited;
  if (Msg.WParam <> SB_BOTTOM) and (Msg.WParam <> SB_LINEUP) then
  begin
    ZeroMemory(@info, SizeOf(info));
    info.cbSize := SizeOf(TScrollInfo);
    info.fMask := SIF_ALL;
    if GetScrollInfo(handle, SB_VERT, info) then
      if info.nPos+Integer(info.nPage) >= info.nMax then
        SendMessage(Handle, WM_VSCROLL, SB_BOTTOM, 0);
  end;
end;

procedure TMyGrid.FixScrollBar;
var
  info: TScrollInfo;
begin
  ZeroMemory(@info, SizeOf(info));
  with info do
  begin
    cbsize := SizeOf(info);
    fmask  := SIF_ALL;
    GetScrollInfo(Handle, SB_VERT, info);
    fmask := fmask or SIF_PAGE;
    nPage := Height div DefaultRowHeight-1;
  end;
  SetScrollInfo(Handle, SB_VERT, info, True);
end;

_________________
Debuggers don't remove bugs, they only show them in slow-motion.