Autor Beitrag
Seven of Nine
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 132
Erhaltene Danke: 1

Win XP, Win Vista HomePro
Delphi 2009
BeitragVerfasst: Fr 23.12.11 06:41 
Warum scrollt ein (Standard)Stringgrid beim ziehen des vertikalen Scrollbars verzögert. oder, besser formuliert, warum zeigt es die gewählte Stelle erst beim Loslassen des Scrollbars?
Oder, noch wichtiger, wie kann ich bewirken das der Inhalt des Stringgrids beim ziehen des scrollbars mitscrollt?

Danke & lG Martin


Moderiert von user profile iconNarses: Topic aus Delphi Language (Object-Pascal) / CLX verschoben am Fr 23.12.2011 um 09:59
bummi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1248
Erhaltene Danke: 187

XP - Server 2008R2
D2 - Delphi XE
BeitragVerfasst: Fr 23.12.11 08:38 
Die Message WMVScroll verbiegen ...
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:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
unit pp;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Buttons, Grids;

type
  TStringGrid=Class(Grids.TStringGrid)
    procedure WMVScroll(var Message: TWMVScroll); message WM_VSCROLL;
  end;

  TForm1 = class(TForm)
    StringGrid1: TStringGrid;
    procedure SpeedButton1Click(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.SpeedButton1Click(Sender: TObject);
begin

end;

{ TStringGrid }

procedure TStringGrid.WMVScroll(var Message: TWMVScroll);
begin
   if Message.ScrollCode = 5 then Message.ScrollCode := 4;
   inherited;
end;

end.

_________________
Das Problem liegt üblicherweise zwischen den Ohren H₂♂
DRY DRY KISS
SvenAbeln
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 334
Erhaltene Danke: 3



BeitragVerfasst: Fr 23.12.11 09:21 
Aktiviere mal goThumbTracking in den Options vom StringGrid.
bummi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1248
Erhaltene Danke: 187

XP - Server 2008R2
D2 - Delphi XE
BeitragVerfasst: Fr 23.12.11 10:51 
@SvenAbeln oups, den hatte ich übersehen, meine Routine war ursprünglich für DBGgrid geschrieben ...

_________________
Das Problem liegt üblicherweise zwischen den Ohren H₂♂
DRY DRY KISS
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19338
Erhaltene Danke: 1752

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Fr 23.12.11 11:55 
In den meisten Fällen ist es ohnehin sinnvoller als Alternative die VirtualTrees zu verwenden. Das ist einfacher (wenn man es denn verstanden hat), deutlich schneller, sieht besser aus und man kann damit deutlich mehr machen.
Seven of Nine Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 132
Erhaltene Danke: 1

Win XP, Win Vista HomePro
Delphi 2009
BeitragVerfasst: Sa 24.12.11 05:34 
Danke für Eure Hilfe!
Ebenso für den Hinweise mit der VirtualTreeView ....Hamerteil ist das!

lG Martin