With the help of the Edit component, enter the words into the ListBox components: in the first one - “I”, “I can”, “write”, “any”, “program”; in the second - “Hacker”, “all”, “programs”, “remake”, “seeks”. Using the code, connect both ListBox components to each other so that when you select any order of the word in one, it will lead to the choice of the same order of the word in the other component, and both of these words will appear in the Memo component (on a new line).
1 answer
Edit
:
Edit.Text := someVar; // пишем someVar в Edit someVar := Edit.Text; // читаем с Edit в someVar
At ListBox
'a:
ListBox.Add(someVar); // добавление нового элемента с текстом someVar selectedItem := ListBox.ItemIndex; // № выбранного элемента (начиная с нуля) someVar := ListBox.Items[selectedItem]; // значение элемента selectedItem
At Memo
:
Memo.Add(someVar); // добавление новой строчки с текстом someVar someVar := Memo.Lines[lineIndex]; // значение строки lineIndex someVar := Memo.Text; // читаем весь текст с Memo в someVar Memo.Text := someVar; // записываем someVar в Memo (перезапишется всё)
If you need the current line in Memo
, then you need to look towards CaretPos
.
And prepare a ready-made solution for yourself - this will help not to forget everything in the exam. Good luck!
- 2Do not feed, you take away the bread from teachers and create unnecessary work to personnel departments. - karmadro4
- 2Well, I will not :) - xEdelweiss
|
Skype.
developersSkype.
- Costantino Rupert