yuhoo
asked on
ListBox OnScroll
I need OnScrool event for list boxes. How to make it?
In fact I want two list boxes to be synchronized, ie when user scrolls through first, the second follows it automatically...
In fact I want two list boxes to be synchronized, ie when user scrolls through first, the second follows it automatically...
hi
there is a component on delphi super page to do this.
http://sunsite.icm.edu.pl/delphi/
it's called something like hslistbox.zip
i not tried it myself but supposed to be ok.
Regards Barry
there is a component on delphi super page to do this.
http://sunsite.icm.edu.pl/delphi/
it's called something like hslistbox.zip
i not tried it myself but supposed to be ok.
Regards Barry
yuhoo
You can use the GetScrollInfo and the SetScrollInfo API calls to synchronize the listboxs something like...
GetScrollinfo(Listbox1.Han dle, SB_CTL, SIF_POS or SIF_RANGE or SIF_PAGE );
SetScrollinfo(Listbox2.Han dle, SB_CTL, SIF_POS or SIF_RANGE or SIF_PAGE, True);
To create an OnScroll event you can try this...it's just an example I have not tested it so I'm not sure if it will work....
private
FOnScroll : TNotifyEvent;
protected
procedure CMScroll(var Message: TMessage); message CM_SCROLL;
published
property OnScroll: TNotifyEvent read FOnScroll write FOnScroll;
then the procedure...
procedure TListBoxEx.CMScroll(var Message: TMessage);
begin
inherited;
if Assigned (FOnScroll) then FOnScroll(Self);
end;
Later
BoRiS
You can use the GetScrollInfo and the SetScrollInfo API calls to synchronize the listboxs something like...
GetScrollinfo(Listbox1.Han
SetScrollinfo(Listbox2.Han
To create an OnScroll event you can try this...it's just an example I have not tested it so I'm not sure if it will work....
private
FOnScroll : TNotifyEvent;
protected
procedure CMScroll(var Message: TMessage); message CM_SCROLL;
published
property OnScroll: TNotifyEvent read FOnScroll write FOnScroll;
then the procedure...
procedure TListBoxEx.CMScroll(var Message: TMessage);
begin
inherited;
if Assigned (FOnScroll) then FOnScroll(Self);
end;
Later
BoRiS
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You can use the GetScrollInfo and the SetScrollInfo API calls to synchronize the listboxs something like...
GetScrollinfo(Listbox1.Han
SetScrollinfo(Listbox2.Han
To create an OnScroll event you can try this...it's just an example I have not tested it so I'm not sure if it will work....
private
FOnScroll : TNotifyEvent;
protected
procedure CMScroll(var Message: TMessage); message CM_SCROLL;
published
property OnScroll: TNotifyEvent read FOnScroll write FOnScroll;
then the procedure...
procedure TListBoxEx.CMScroll(var Message: TMessage);
begin
inherited;
if Assigned (FOnScroll) then FOnScroll(Self);
end;
Later
BoRiS