![]() |
from TListView to VirtualStringTree
hi i use the following Code with the TListView :
Delphi-Quellcode:
But when i apply it with the TVirtualStringTree like this :
// LV := TListView
procedure TForm1.umQUARPROPMSG(var Msg: TMessage); var Item : TListItem; i : integer; res : boolean; info : TMyInfo; begin Msg.Result := 1; res := Msg.LParam = 0; Item := lv.Selected; if Item <> nil then begin i := Item.Index; if Msg.LParam <> 0 then Inc(i, Msg.LParam) else Inc(i, Msg.WParam); if (i < 0) or (i >= lv.Items.Count) then Msg.Result := 0 else begin Item := lv.Items[i]; lv.Selected := Item; Item.MakeVisible(false); Item.Focused := true; Update; if res then begin info := TMyInfo(Item.Data); with FMyInfo as TMyIndo do begin info.GetInfoText(Memo1.Lines, Memo1.ClientWidth -8, Memo1.Font); Memo1.SelStart := 0; Memo1.SelLength := 0; end; end; end; end; end;
Delphi-Quellcode:
that doesn't give the same result .
//Vst:=TVirtualStringTree
procedure TForm1.umQUARPROPMSG_(var Msg: TMessage); var // Item : TListItem; Node: PVirtualNode; Data: PTreeData; i : integer; res : boolean; info : TMyInfo; begin Msg.Result := 1; res := Msg.LParam = 0; // Item := lv.Selected; Node:=VST.FocusedNode; Data:=VST.GetNodeData(Node); if Node <> nil then begin i:=node.Index; // i := Item.Index; if Msg.LParam <> 0 then Inc(i, Msg.LParam) else Inc(i, Msg.WParam); if (i < 0) or (i >=vst.TotalCount)then Msg.Result := 0 else begin // Item := lv.Items[i]; vst.FocusedNode:=node; vst.Focused; // lv.Selected := Item; // Item.MakeVisible(false); // Item.Focused := true; Update; if res then begin info := TMyInfo(data); with FMyInfo as TMyInfo do begin info.GetInfoText(Memo1.Lines, Memo1.ClientWidth -8, Memo1.Font); Memo1.SelStart := 0; Memo1.SelLength := 0; end; end; end; end; end; Is there any error with Code used in VST ? |
Re: from TListView to VirtualStringTree
What do you mean with
Zitat:
|
Re: from TListView to VirtualStringTree
thank you chaosben
i meant the result is not the same as with the TListView . the code does a TListView auto-scroll from a Second Form where i have 2 buttons ( UP_Scroll and DOWN_Scroll ) of course via the Msg . the code works good with the TListView and i can see the UP_scroll and DOWN_scroll with IT . but with TVirtualStringTree :wall: if you want i can attache a little sample of IT ? |
Re: from TListView to VirtualStringTree
tell me what your function should do, please.
i'm sure there is a much simpler way in vst style. |
Alle Zeitangaben in WEZ +1. Es ist jetzt 08:57 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz