Home
Top.Mail.Ru Yandeks.Metrika
Forum: "Main";
Current archive: 2002.01.08;
Download: [xml.tar.bz2];

Down

ListBox Find similar branches


Ser_Kham1   (2001-12-17 16:10) [0]

Good afternoon, gentlemen.
I read help on the ListBox and read in the description of the Items property:
"By default, the items in a list box are of type TStrings."
And what can somehow be changed is By default and done so that items in
a list box are of any other type?
Regards, baby.



MBo   (2001-12-17 16:18) [1]

a) no, unless you rewrite it yourself
b) there is no need, because to every line in strings you can attach an object - any!



Fellomena   (2001-12-17 17:08) [2]

Mbo said it right, here is an example:

was
i: real;
begin
i: = 1.35;
i: = sqrt (i * i);
ListBox1.Items [0]: = FloatToStr (i); // type conversion mechanism
end;

=)



MBo   (2001-12-17 17:12) [3]

I meant listbox1.items.objects [i]



Fellomena   (2001-12-17 17:14) [4]

... who cares ?



Ser_Kham1   (2001-12-17 17:19) [5]

Thanks MBo. It will suit me. However, the question arises, when I insert or add new elements to the list, I will need to dynamically create the corresponding Objects. However, then I will probably need to take care of deleting dynamically created Objects, or will the compiler do the dirty work for me?



Виктор Щербаков   (2001-12-17 17:23) [6]

You will have to delete it yourself.
To destroy objects automatically you need to use
TObjectList.



Dimka Maslov   (2001-12-17 17:24) [7]

The compiler will not do the dirty work. You need to take care of creating objects and freeing them yourself.



MBo   (2001-12-17 17:25) [8]

the difference in the ability to add ANY object - from the icon to the featured component, if, of course, such a desire arises

Yes, you must delete it manually. From the standard Delphi data structures, as far as I remember, only TObjectList itself releases its elements.



Fellomena   (2001-12-17 17:31) [9]

2 Mbo: yes no ... the difference between the object and, for example, the string value, I understand =)
I meant that the implementation (software) of the ListBox does not change (if you know what I mean).



MBo   (2001-12-17 17:37) [10]

I got it.



Pages: 1 whole branch

Forum: "Main";
Current archive: 2002.01.08;
Download: [xml.tar.bz2];

Top









Memory: 0.84 MB
Time: 0.023 c
6-22288
atmospheric
2001-10-09 23:49
2002.01.08
WinGate


1-22080
Delphimun
2001-12-18 17:11
2002.01.08
How to load the cursor from the resource, and then save it to disk?


1-22109
avr555
2001-12-19 17:17
2002.01.08
Combobox in Grid


6-22278
garage
2001-10-02 12:27
2002.01.08
Tell me the algorithm for replacing large letters with small letters.


1-22112
greenrul
2001-12-15 13:55
2002.01.08
Prompt component Button





afrikaans albanian Arabic armenian azerbaijani basque belarusian bulgarian catalan Chinese (Simplified) Chinese (Traditional) croatian Czech danish Dutch English estonian filipino finnish French
galician georgian German greek haitian Creole hebrew Hindi hungarian icelandic indonesian Irish italian japanese Korean latvian lithuanian macedonian malay maltese norwegian
persian polish portuguese Romanian russian serbian slovak Slovenian Español swahili Swedish thai turkish Ukrainian urdu vietnamese welsh yiddish bengali bosnian
cebuano Esperanto gujarati hausa hmong igbo javanese kannada khmer lao latin maori marathi mongolian nepali punjabi somali tamil telugu yoruba
zulu
English French German Italian Portuguese Russian Spanish