Home > Back-end >  Set up three listview, how to realize the three controls of the scroll bar synchronous rolling?
Set up three listview, how to realize the three controls of the scroll bar synchronous rolling?

Time:09-25

My current method is to change in the listview1 scroll event listview2 and listview3 scrollbar position, but I don't know the difference between the scroll bar up and down, the code to run the results in the first and the last synchronization,
Lprocedure TForm2. NewWndProc (var _msg: TMessage);
Var
Scrollinfo1: TScrollinfo;
Pos: integer;
The begin
FOldWndProc (_msg);
With the _msg do
The begin
Case Msg of
WM_VSCROLL:
The begin
Scrollinfo1. CbSize:=sizeof (Scrollinfo1);
Scrollinfo1. FMask:=SIF_ALL;
Getscrollinfo (listview1. Handle, SB_VERT scrollinfo1);
Pos:=Scrollinfo1. NPos;
If the _msg. WParam> 0 then
The begin
Sendmessage (listview2. Handle, WM_VSCROLL SB_LINEUP, 0).
Sendmessage (listview3. Handle, WM_VSCROLL SB_LINEUP, 0).
End
The else
The begin
Sendmessage (listview2. Handle, WM_VSCROLL SB_LINEDOWN, 0).
Sendmessage (listview3. Handle, WM_VSCROLL SB_LINEDOWN, 0).
end;
end;
end;
end;
end;

CodePudding user response:

Can use the controls, the three listview is set to the same height, and then call the same scroll bar, can use BusinessSkinForm controls
  • Related