delphiÖÐTreeViewʹÓÃ
TreeViewÓɽڵ㹹³É£¬½¨Ê÷ͨ¹ý¶ÔTreeView.itemsÊôÐÔ½øÐвÙ×÷¡£ItemsÊÇÒ»¸öTTreeNodes¶ÔÏó£¬ÕâÊÇÒ»¸öTTreeNode¼¯¡£
Ò»¡¢Õë¶ÔTTreeNodes,Ò²¾ÍÊÇ TreeView.Items,ÓÐÕâЩÊôÐÔ£º
1¡¢count£¬½Úµã¸öÊý¡£
2¡¢item[index] ,ͨ¹ýindexµÃµ½½Úµã¡£
¶þ¡¢Õë¶ÔTTreeNodes,Ò²¾ÍÊÇ TreeView.Items,³£ÓõÄÌí¼Ó½ÚµãµÄ²Ù×÷ÓУº
AddFirstÌí¼ÓµÚÒ»¸ö¸ù½Úµã¡£Óɴ˺¯ÊýÌí¼ÓµÄ½Úµã×ÜÅÅÔÚÇ°Ã棬³ý·ÇºóÀ´ÓÖʹÓô˺¯ÊýÌí¼ÓÁËÒ»¸ö½Úµã£¬ÔòºóÌí¼ÓµÄ½Úµã½«ÅÅÔÚÇ°Ãæ¡£¸Ãº¯Êý·µ»ØÐÂÌí¼ÓµÄ½Úµã¡£
AddChildFirstÌí¼ÓµÚÒ»¸ö×ӽڵ㣬ҪÇóÓи¸½Úµã×÷ΪÆä²ÎÊý¡£·µ»ØÐÂÌí¼ÓµÄ½Úµã¡£
AddChildÌí¼ÓÒ»¸ö×ӽڵ㣬ҪÇóÓи¸½Úµã×÷ΪÆä²ÎÊý¡£·µ»ØÐÂÌí¼ÓµÄ½Úµã¡£
AddÌí¼ÓÒ»¸öÐֵܽڵ㣬ҪÇóÓÐÐֵܽڵã×÷ΪÆä²ÎÊý¡£·µ»ØÐÂÌí¼ÓµÄ½Úµã¡£
Èý¡¢Õë¶ÔTTreeNodes,Ò²¾ÍÊÇ TreeView.Items,³£Óõĵõ½½ÚµãµÄ²Ù×÷ÓУº
GetFirstNode() µÃµ½¸ù½Úµã¡£
È»ºóÅäºÏTTreeNode.GetNext(),¾Í¿ÉÒÔ·ÃÎÊËùÓеĽڵ㡣
ËÄ¡¢½¨Ê÷¾ÙÀý£º
var
root_node,cur_node:TTreeNode;
begin
root_node:=AddFirst(nil,¸ù½Úµã1);
cur_node:=addChildfirst(root_node,nil,¸ù½Úµã1_child1);
add(cur_node,¸ù½Úµã1_child2);
root_node:=Add(nil,¸ù½Úµã2);
AddChildFirst(root_node,¸ù½Úµã2_child1);
end;
Î塢ʼþ´¥·¢£º
µ±´ÓÒ»¸ö½ÚµãÌøµ½ÁíÒ»¸ö½Úµã£¬»á´¥·¢TTreeView.OnChangeʼþ¡£¸ÃʼþÖУ¬½«´«µÝnode,¼´µ±Ç°±»Ñ¡ÖеĽڵ㡣
µ±ÐÞ¸ÄÒ»¸ö½ÚµãµÄtextʱ£¬»á´¥·¢TTreeView.onEditʼþ¡£
Áù¡¢½«½ÚµãºÍ½ÚµãËù¶ÔÓ¦µÄÊý¾ÝÁªÏµÆðÀ´
¶ÔÓÚÿ¸öTTreeNode,ÓиöDataÊôÐÔ£¬¿ÉÒÔ´æ·ÅÒ»¸öÖ¸Õë¡£ÎÒÃÇ¿ÉÒÔÀûÓÃÕâ¸öÓòÀ´´æ·ÅÓë½Úµã¶ÔÓ¦µÄ×Ô¼ºµÄÊý¾Ý¡£
1.ÎÒÃÇÏȶ¨ÒåÒ»¸öÊý¾Ý½á¹¹£¬×÷Ϊ¼Ç¼ÎÒÃÇÒª¼Ç¼µÄÊý¾Ý¡£È磺
type
PMyData=^TMyData;
TMyData=Record
sFName:string;
sLName:String;
nIndex:integer;
end;
2.È»ºó£¬´´½¨Êýʱ£¬½«½ÚµãºÍ½ÚµãÊý¾ÝÁªÏµÆðÀ´£º
procedure TForm1.Button1Click(Sender: TObject);
var
myshuju: PMyData
cur_node:TTreeNode;
begin
New(myshuju); //¼Çס£¬Ò»¶¨ÒªÏÈ·ÖÅäÄÚ´æ¡£Óм¸¸ö½Úµã£¬¾ÍÒª·ÖÅ伸´ÎÄÚ´æ¡£
myshuju^.FName:=Edit1.Text;
Myshuju^.LName := Edit2.Text;
TreeViewI
Ïà¹ØÎĵµ£º
Delphi±àдϵͳ·þÎñÒ»£ºÈçºÎ±àдһ¸öϵͳ·þÎñ ÊÕ²Ø
´ò¿ªDelphi±à¼Æ÷£¬Ñ¡Ôñ²Ëµ¥ÖеÄFile|New|Other...£¬ÔÚNew ItemÖÐÑ¡ÔñService ApplicationÏDelphi±ã×Ô¶¯ÎªÄ㽨Á¢Ò»¸ö»ùÓÚTServiceApplicationµÄй¤³Ì£¬TserviceApplicationÊÇÒ»¸ö·â×°NT·þÎñ³ÌÐòµÄÀ࣬Ëü°üº¬Ò»¸öTService1¶ÔÏóÒÔ¼°·þÎñ³ÌÐòµÄװж¡¢×¢²á¡¢È¡Ïû· ......
procedure Delay(msecs:integer);
var
Tick: DWord;
Event: THandle;
begin
Event := CreateEvent(nil, False, False, nil);
try
Tick := GetTickCount + DWord(msecs);
while (msecs > 0) and (MsgWaitForMultipleObjects(1, Event, False, msecs, QS_ALLINPUT) <&g ......
delphiÖеÄDLLÖеÄÉùÃ÷ÔÂëÈçÏ£º
ÕâÀïÉùÃ÷ÁËÊä³öÐÔ²ÎÊý·Ö±ðΪÊý×ÖÓë×Ö·ûÀàÐÍ
library dll1;
uses
SysUtils,
Classes;
{$R *.res}
Function mymax(x, y: Integer; out jj: Integer; out abc: PChar): Integer; stdcall;
begin
jj := x * y;
abc := PChar(StrPas(abc) + 'ÕâÊÇ´«³öµÄ' ......
ÎÒһֱʹÓÃDelphi6¿ª·¢Èí¼þ£¬¿´µ½CSDNÉϵÄOPhoneÊÖ»ú¿ª·¢£¬ÓÖÈ¥GoogleÒ»·¬£¬Ìý˵±àдÊÖ»úÈí¼þ
ÄÜ׬Ǯ£¬ËùÒÔҪѧϰJava ME£¬¶ÁÁ˼¸Ì첩ÎÄ£¬´ó¶àÊý¸ÅÄî¸ãÇå³þÁË¡£
ҪѧJavaME¾ÍµÃÏÈѧJavaSE£¬ËùÒÔ×°Á˺ܶàÈí¼þ(²»×°ÄÇô¶à£¬OPhone¾Í×°²»ÉÏÈ¥)¡£
ÍƼöһƪÓÅÐãµÄÎÄÕ£º
ÔÚ NetBeans IDE ÖÐÉè¼Æ Swing GUI
¶ÁÍêÕâƪÎÄÕ£¬³õ ......
DelphiÖи߼¶DLLµÄ±àдºÍµ÷Óü¼ÇÉ
¸ù¾ÝDelphiÌṩµÄÓÐ¹Ø DLL±àдºÍµ÷ÓõİïÖúÐÅÏ¢£¬Äã¿ÉÒԺܿìÍê³ÉÒ»°ãµÄ DLL±àдºÍµ÷ÓÃµÄ Ó¦ÓóÌÐò¡£±¾ÎĽéÉܵÄÖ÷ÌâÊÇÈçºÎ±àдºÍµ÷ÓÃÄܹ»´«µÝ¸÷ÖÖ²ÎÊý£¨°üÀ¨¶ÔÏóʵÀý£©µÄ DLL¡£ÀýÈ磬 Ö÷½Ð³ÌÐò´«µÝ¸ø DLLÒ»¸öADOConnection ¶ÔÏóʾÀý×÷Ϊ²ÎÊý£¬ DLLÖеĺ¯ÊýºÍ
¸ù¾ÝDelphiÌṩµÄÓÐ¹Ø DLL±àÐ ......