TStringList... Var sl:TStringlist;begin SL:=TStringlist.Create(); ..... ..... SL.Free;end; 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 我可以将它附给Tlistview吗,怎么用 晕,不能tstringlist类似于一个字符串数组 在class.pas里的定义: TStringList = class(TStrings) private FList: PStringItemList; FCount: Integer; FCapacity: Integer; FSorted: Boolean; FDuplicates: TDuplicates; FOnChange: TNotifyEvent; FOnChanging: TNotifyEvent; procedure ExchangeItems(Index1, Index2: Integer); procedure Grow; procedure QuickSort(L, R: Integer; SCompare: TStringListSortCompare); procedure InsertItem(Index: Integer; const S: string); procedure SetSorted(Value: Boolean); protected procedure Changed; virtual; procedure Changing; virtual; function Get(Index: Integer): string; override; function GetCapacity: Integer; override; function GetCount: Integer; override; function GetObject(Index: Integer): TObject; override; procedure Put(Index: Integer; const S: string); override; procedure PutObject(Index: Integer; AObject: TObject); override; procedure SetCapacity(NewCapacity: Integer); override; procedure SetUpdateState(Updating: Boolean); override; public destructor Destroy; override; function Add(const S: string): Integer; override; procedure Clear; override; procedure Delete(Index: Integer); override; procedure Exchange(Index1, Index2: Integer); override; function Find(const S: string; var Index: Integer): Boolean; virtual; function IndexOf(const S: string): Integer; override; procedure Insert(Index: Integer; const S: string); override; procedure Sort; virtual; procedure CustomSort(Compare: TStringListSortCompare); virtual; property Duplicates: TDuplicates read FDuplicates write FDuplicates; property Sorted: Boolean read FSorted write SetSorted; property OnChange: TNotifyEvent read FOnChange write FOnChange; property OnChanging: TNotifyEvent read FOnChanging write FOnChanging; end; 它是一个字符列表类。 tobject --tstring-tstringlist 那我怎么显示 tstringlist 里的内容 var i:Integer;begin for i:=0 to StringList.Count-1 do ShowMessage(StringList[i]);end; 有没有用SynEdit的? 多线程中调用dll的问题。 调用 如何将数据进行异地传输(急!!!) 调查一下,北京和上海的delphi程序员工资。 寻求开发建议!!!请高手快进!!解决就另加分!! 谁能介绍几个好用的打印控件?并说明如何使用! 在用C++Builder把以前写的程序改成ActiveForm时出现了与VCL有关的问题,如何解决?急急急满头大汗! 拷贝文件时能否调用系统的那个对话框(显示拷贝进度的)?? 请大家帮我看一下我的程序为什么达不到预期要求?(数据库方面) 很迷茫 想要判断dblistbox 中是否还有内容?
tstringlist类似于一个字符串数组
TStringList = class(TStrings)
private
FList: PStringItemList;
FCount: Integer;
FCapacity: Integer;
FSorted: Boolean;
FDuplicates: TDuplicates;
FOnChange: TNotifyEvent;
FOnChanging: TNotifyEvent;
procedure ExchangeItems(Index1, Index2: Integer);
procedure Grow;
procedure QuickSort(L, R: Integer; SCompare: TStringListSortCompare);
procedure InsertItem(Index: Integer; const S: string);
procedure SetSorted(Value: Boolean);
protected
procedure Changed; virtual;
procedure Changing; virtual;
function Get(Index: Integer): string; override;
function GetCapacity: Integer; override;
function GetCount: Integer; override;
function GetObject(Index: Integer): TObject; override;
procedure Put(Index: Integer; const S: string); override;
procedure PutObject(Index: Integer; AObject: TObject); override;
procedure SetCapacity(NewCapacity: Integer); override;
procedure SetUpdateState(Updating: Boolean); override;
public
destructor Destroy; override;
function Add(const S: string): Integer; override;
procedure Clear; override;
procedure Delete(Index: Integer); override;
procedure Exchange(Index1, Index2: Integer); override;
function Find(const S: string; var Index: Integer): Boolean; virtual;
function IndexOf(const S: string): Integer; override;
procedure Insert(Index: Integer; const S: string); override;
procedure Sort; virtual;
procedure CustomSort(Compare: TStringListSortCompare); virtual;
property Duplicates: TDuplicates read FDuplicates write FDuplicates;
property Sorted: Boolean read FSorted write SetSorted;
property OnChange: TNotifyEvent read FOnChange write FOnChange;
property OnChanging: TNotifyEvent read FOnChanging write FOnChanging;
end;
tobject --tstring-tstringlist
i:Integer;
begin
for i:=0 to StringList.Count-1 do
ShowMessage(StringList[i]);
end;