Solved

2 Listboxes

Posted on 2010-09-12
4
228 Views
Last Modified: 2012-08-13
Hi all,

Should be an easy question. I have 2 listboxes on my form. What I am trying to do is the following. I am reading data from my serial port and adding it to listbox1 but I need to "pause" it some times so I have an invisible listbox2 also to which the data is then directed when in "paused" state. So how do I append all the data from listbox2 into listbox when "unpaused"?
0
Comment
Question by:DigitalNam
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 5

Accepted Solution

by:
Mechanic_Kharkov earned 500 total points
ID: 33657103
Listbox1.Items.BeginUpdate;
Listbox1.Items.AddStrings(ListBox2.Items);
ListBox1.Items.EndUpdate;

;-)
0
 
LVL 1

Author Closing Comment

by:DigitalNam
ID: 33657143
Hehehe thanks Mechanic Kharkov... works like a charm. Thanks for the quick response.
0
 
LVL 5

Expert Comment

by:Mechanic_Kharkov
ID: 33657166
Not at all. And one more thing: You don't need to use hidden listbox, just use TStringList to collect lines. E.g.:

var ReservedList: TStringList;

begin
 ReservedList := TStringList.Create();
try
   ... //use it
finally
  ReservedList.Free;
end;
end;

This list is the same as TListbox.Items. You can Clear it, Add, AddStrings, and so on. But it has no visual representation on your form. You can create it in FormCreate method and free in FormClose as well.
0
 
LVL 1

Author Comment

by:DigitalNam
ID: 33657188
Thank you for the suggestion.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question