W
wangfu
Unregistered / Unconfirmed
GUEST, unregistred user!
小弟,用TreeView想按Int的整数排序,Delphi(Help)如下:
function CustomSortProc(Node1, Node2: TTreeNode; Data: Longint): Integer; stdcall;
begin
if Data = 0 then
Result := AnsiStrIComp(Pchar(Node1.Text), PChar(Node2.Text));
else
Result := -AnsiStrIComp(PChar(Node1.Text), PChar(Node2.Text));
end;
TreeNode1.CustomSort(@CustomSortProc, 0); { Sorts in ascending order }
TreeNode1.CustomSort(@CustomSortProc, 1); { Sorts in descending order }
但是,提示出错,不知Why?
望各位大虾Help me!!!
50两黄金奉上。
function CustomSortProc(Node1, Node2: TTreeNode; Data: Longint): Integer; stdcall;
begin
if Data = 0 then
Result := AnsiStrIComp(Pchar(Node1.Text), PChar(Node2.Text));
else
Result := -AnsiStrIComp(PChar(Node1.Text), PChar(Node2.Text));
end;
TreeNode1.CustomSort(@CustomSortProc, 0); { Sorts in ascending order }
TreeNode1.CustomSort(@CustomSortProc, 1); { Sorts in descending order }
但是,提示出错,不知Why?
望各位大虾Help me!!!
50两黄金奉上。