Solved

2 Listboxes

Posted on 2010-09-12
4
229 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

696 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