Solved

2 Listboxes

Posted on 2010-09-12
4
227 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
  • 2
  • 2
4 Comments
 
LVL 5

Accepted Solution

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

;-)
0
 
LVL 1

Author Closing Comment

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

Expert Comment

by:Mechanic_Kharkov
Comment Utility
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
Comment Utility
Thank you for the suggestion.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

728 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now