Das musst du halt nur auf deine CheckListboxen übertragen, drüfte aber kein Problem sein.
Das ist das, was Jens gemeint hat.
Delphi-Quellcode:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 =
class(TForm)
ListBox1: TListBox;
ListBox2: TListBox;
procedure FormCreate(Sender: TObject);
private
{ Private-Deklarationen }
OldGridProc1, OldGridProc2: TWndMethod;
procedure Grid1WindowProc(
var Message: TMessage);
procedure Grid2WindowProc(
var Message: TMessage);
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
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;