delphi 在 DragDrop 的时候,滚动 TreeView

在 DragDrop 的时候,滚动 TreeView

当高度不够的时候


 
 
procedure TForm1.TreeView1DragOver(Sender, Source:
TObject; X, Y: Integer;
  State: TDragState; var Accept: Boolean);
begin
  if (y < 15) then
   {On
the upper edge - should scroll up
}
     SendMessage(TreeView1.Handle,
WM_VSCROLL, SB_LINEUP, 0)
  else if
(TreeView1.Height - y <
15) then
   { On
the lower edge - should scroll down
}
      SendMessage(TreeView1.Handle,
WM_VSCROLL, SB_LINEDOWN, 0);
 
 
 
    Accept
:= Source =
Sender;
    if not Accept then
exit;
end;

来自为知笔记(Wiz)

delphi 在 DragDrop 的时候,滚动 TreeView

时间: 2024-10-27 06:59:08

delphi 在 DragDrop 的时候,滚动 TreeView的相关文章

delphi 文件或目录转换成 TreeView

//文件或目录转换成 TreeView procedure DirToTreeView(Tree: TTreeView; Directory: string; Root: TTreeNode; IncludeFiles:  Boolean);var  SearchRec         : TSearchRec;  ItemTemp          : TTreeNode;begin  with Tree.Items do  try    BeginUpdate;    if Director

iOS RATreeView 问题总结

项目地址:https://github.com/Augustyniak/RATreeView 问题一:点击cell的时候分割线不见了 解决办法:https://github.com/Augustyniak/RATreeView/issues/28 问题二:当数据量过大时,展开和滚动treeView会变得很卡 解决办法:https://github.com/Augustyniak/RATreeView/issues/79 Fork:https://github.com/vbrylinskiy/R

delphi 自动滚动到最底端scroll

自动滚动到最底端scroll Uses MSHTML;{$R *.dfm}var  ScrollPos: integer=0;procedure TForm1.Button1Click(Sender: TObject);begin  inc(ScrollPos, 10);  if WebBrowser1.Document <> nil then    (WebBrowser1.Document as IHTMLDocument2).parentWindow.scroll(0,ScrollPos

delphi treeview 鼠标移动显示hint信息

procedure TForm1.TreeView1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); var Node: TTreeNode; begin with TreeView1 do begin Node := GetNodeAt(X, Y); ShowHint := (Node <> nil); if ShowHint then begin Hint := Node.Text; Application.Act

Delphi TreeView – 自动展开树形结构

Delphi TreeView – 自动展开树形结构 当处理完TreeView控件树形结构的数据后,需要默认自动全部展开,可以用到TreeView的Expanded属性. 1 2 3 4 5 6 7 8 9 10 var       icount : integer; begin RzTreeView1.Items.EndUpdate; //示例中用的是Raize中的RzTreeView组件 for icount := 0 to RzTreeView1.Items.Count-1 do     

delphi TreeView修改选中的节点的颜色和背景

TreeView修改选中的节点的颜色和背景 TCustomDrawTarget = (dtControl, dtItem, dtSubItem); TCustomDrawStage = (cdPrePaint, cdPostPaint, cdPreErase, cdPostErase); TCustomDrawState = set of (cdsSelected, cdsGrayed, cdsDisabled, cdsChecked, cdsFocused, cdsDefault, cdsHo

delphi 如何知道 Treeview,Listview 当前最上面显示的节点

如何知道 Treeview,的节点是根节点 procedure TForm1.TreeView1ContextPopup(Sender: TObject; MousePos: TPoint;  var Handled: Boolean);begin    if TreeView1.Selected.IsFirstNode then       mni_delete.Enabled:=false    else    mni_delete.Enabled:=True; end; 来自为知笔记(Wi

delphi 去掉TreeView水平滚动条

使用API函数:声明 FUNCTION ulong ShowScrollBar(ulong hwnd,ulong wBar,ulong bShow) LIBRARY "user32.dll" 调用constant long SB_HORZ = 0constant long SB_VERT = 1constant long SB_BOTH = 3ShowScrollBar(Handle(TreeView1),SB_HORZ,0);//隐藏水平滚动条 ShowScrollBar(Handl

delphi 获取 TreeView选中的文件路径

//获取 TreeView选中的文件路径 unit Unit1; interface uses  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,  Dialogs, StdCtrls, ComCtrls; type  TForm1 = class(TForm)    TreeView1: TTreeView;    ListView1: TListView;    RichEdit1: TRic