delphi - Is it possible to store a record in a ListBox's Item.Object property? -
i have record store each item add listbox. need make record class instead accomplish this?
tserverrec = record id: integer; displayname: string; address: string; port: integer; end; procedure tmainform.popuplateservers; var server: tserverrec; begin server in fserverlist begin lbservers.addobject(server.displayname, server); end; end;
no, store pointer record bit of typecasting. you're getting dynamic record pointer allocation, can bit of headache. why not make tserverrec object?
Comments
Post a Comment