Autor Beitrag
JRegier
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1268

Win XP Home, Prof, 2003 Server
D6 Enterprise
BeitragVerfasst: Mi 13.07.05 21:37 
Hallo, wer kann mir sagen welche Ereignisroutine tritt auf beim Scrollen einer TScrollBox?

Danke schon mal im Voraus für Eure Mühe!
maxk
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1696
Erhaltene Danke: 1

Win XP, Debian Lenny
Delphi 6 Personal
BeitragVerfasst: Mi 13.07.05 21:42 
Du kannst die Windowsmessages WM_HSCROLL und WM_VSCROLL abfangen. Eine fertige Routine gibt es leider (noch) nicht :(

_________________
Ein Computer wird das tun, was Du programmierst - nicht das, was Du willst.
JRegier Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1268

Win XP Home, Prof, 2003 Server
D6 Enterprise
BeitragVerfasst: Mi 13.07.05 22:05 
user profile iconmaxk hat folgendes geschrieben:
Du kannst die Windowsmessages WM_HSCROLL und WM_VSCROLL abfangen. Eine fertige Routine gibt es leider (noch) nicht :(


Wow ich kenn mich nicht mit Windowsmessages aus! Wie gehe ich das an?
maxk
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1696
Erhaltene Danke: 1

Win XP, Debian Lenny
Delphi 6 Personal
BeitragVerfasst: Mi 13.07.05 22:48 
So sollte es gehen:
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:
unit Unit1;

interface

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

type
  TForm1 = class(TForm)
    ScrollBox1: TScrollBox;
    procedure FormCreate(Sender: TObject);
    procedure ScrollProc(var Message: TMessage);
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

var OldScrollProc:TWndMethod;

procedure TForm1.ScrollProc(var Message: TMessage);
begin
 case Message.Msg of
  WM_HSCROLL: Caption:='Horizontales Scrollen';
  WM_VSCROLL: Caption:='Verticales Scrolles';
 end;
 OldScrollProc(Message);
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
 OldScrollProc:=ScrollBox1.WindowProc;
 ScrollBox1.WindowProc:=ScrollProc;
end;

end.
Bei ScrollProc kannst du dann mit Message.lParam und Message.wParam arbeiten. Dazu gibt's aber bessere Quellen als mich ;)
Suche im MSDN WM_HSCROLL und Suche im MSDN WM_VSCROLL

Gruß,
maxk

_________________
Ein Computer wird das tun, was Du programmierst - nicht das, was Du willst.
JRegier Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1268

Win XP Home, Prof, 2003 Server
D6 Enterprise
BeitragVerfasst: Do 14.07.05 07:24 
Danke für deine Mühe mein Friend! :wink: