<html><head></head><body style="zoom: 0%;"><div dir="auto">Back to the first question. You can append your data with lb.items.text. <br></div>
<div dir="auto">Just prepare your data in a string like this: strtmp:=data1+lineending+data2+lineending+.....<br></div>
<div dir="auto">And append lb.items.text:=lb.items.text+lineending+strtmp<br></div>
<div dir="auto">Yes it is a workaround but do the trick like beginupdate<br></div>
<div dir="auto">Ciao <br><br></div>
<div dir="auto"><!-- tmjah_g_1299s -->Ottieni <!-- tmjah_g_1299e --><a href="https://bluemail.me"><!-- tmjah_g_1299s -->BlueMail per Android<!-- tmjah_g_1299e --></a><!-- tmjah_g_1299s --> <!-- tmjah_g_1299e --></div>
<div class="gmail_quote" >Il giorno 11 Nov 2022, alle ore 16:29, Bo Berglund via lazarus <<a href="mailto:lazarus@lists.lazarus-ide.org" target="_blank">lazarus@lists.lazarus-ide.org</a>> ha scritto:<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="blue">I am using a TListbox component on a form for displaying debug data arriving<br>over a serial line at 115200 baud.<br>The data are a set of MQTT telegram texts which arrive in packets of about 40<br>lines each time (once per 10 seconds).<br>I add them to the listbox as follows:<br><br>procedure THanSimulatorMain.OnRxData(Sender: TObject; const Data: TBytes);<br>var<br> len, oldlen: integer;<br> DataTxt: AnsiString;<br>begin<br> len := Length(Data); //Incoming packet<br> oldlen := Length(DataBuffer);<br> SetLength(DataBuffer, oldlen + len);<br> Move(Data[0], DataBuffer[oldlen], len);<br> SetLength(DataTxt, Length(DataBuffer));<br> Move(DataBuffer[0], DataTxt[1], Length(DataBuffer));<br> lbxRxData.Items.Text := DataTxt; //Add the text to the list<br> lbxRxData.ItemIndex := lbxRxData.Items.Count -1; //To make it visible<br>end;<br><br>DataBuffer is a global TBytes container where the incoming data are stuffed as<br>they arrive (it grows during the session).<br>You see that the buffer contains the complete log history from the start...<br><br>I have noticed that after a while the display becomes very sluggish when data<br>arrives and I think that is due to the way the component operates.<br><br>Now I wonder if there is some way to do as I did when I worked in Delphi with<br>TListView objects, where I could use the BeginUpdate and EndUpdate calls to make<br>all screen updates wait until it was all put in place.<br>This was MUCH faster!<br><br>But I can not find a BeginUpdate on the TListBox object, only BeginUpdateBounds,<br>which does not tell me much....<br><br>Any suggestions?<br><br></pre></blockquote></div></body></html>