Einzelnen Beitrag anzeigen

Benutzerbild von toms
toms
(CodeLib-Manager)

Registriert seit: 10. Jun 2002
4.648 Beiträge
 
Delphi XE Professional
 
#9

Re: 2 ListBoxen verkuppeln (Beim Scrollen)

  Alt 23. Sep 2003, 20:32
Delphi-Quellcode:
private
   OldGridProc1, OldGridProc2: TWndMethod;
   procedure Grid1WindowProc(var Message: TMessage);
   procedure Grid2WindowProc(var Message: TMessage);
 public

{...} 

procedure TForm1.Grid1WindowProc(var Message: TMessage);
begin
  OldGridProc1(Message);
  if ((Message.Msg = WM_VSCROLL) or (Message.Msg = WM_HSCROLL) or
      Message.msg = WM_Mousewheel)) then
  begin
    OldGridProc2(Message);
  end;
end;

procedure TForm1.Grid2WindowProc(var Message: TMessage);
begin
  OldGridProc2(Message);
  if ((Message.Msg = WM_VSCROLL) or (Message.Msg = WM_HSCROLL) or
     (Message.msg = WM_Mousewheel)) then
  begin
    OldGridProc1(Message);
  end;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  OldGridProc1 := ListBox1.WindowProc;
  OldGridProc2 := ListBox2.WindowProc;
  ListBox1.WindowProc := Grid1WindowProc;
  ListBox2.WindowProc := Grid2WindowProc;
end;
Thomas
  Mit Zitat antworten Zitat