我目前的方法是在listview1的滾動條事件中改變listview2和listview3的滾動條位置,但是不知道滾動條向上和向下的區別,代碼運行結果在最開始和最后同步不了。
lprocedure TForm2.NewWndProc(var _msg: TMessage);
var
Scrollinfo1:TScrollinfo;
pos:integer;
begin
FOldWndProc(_msg);
with _msg do
begin
case Msg of
WM_VSCROLL:
begin
Scrollinfo1.cbSize:=sizeof(Scrollinfo1);
Scrollinfo1.fMask:=SIF_ALL;
Getscrollinfo(listview1.Handle,SB_VERT,scrollinfo1);
pos:=Scrollinfo1.nPos;
if _msg.WParam>0 then
begin
sendmessage(listview2.Handle,WM_VSCROLL,SB_LINEUP,0);
sendmessage(listview3.Handle,WM_VSCROLL,SB_LINEUP,0);
end
else
begin
sendmessage(listview2.Handle,WM_VSCROLL,SB_LINEDOWN,0);
sendmessage(listview3.Handle,WM_VSCROLL,SB_LINEDOWN,0);
end;
end;
end;
end;
end;
uj5u.com熱心網友回復:
可以用控制元件,把三個listview設為同樣高度,然后呼叫同一個滾動條,控制元件可以用BusinessSkinForm轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/76045.html
標籤:VCL組件開發及應用
