Lena wrote:I plan to have 5-100 lines in the ListBox with pictures from remote host. Please help me to move this code into a separate TThread in C++ Builder Berlin.

What is the actual problem you are having? Have you ever worked with TThread or TTask before? I've written examples for this kind of scenario before, for example this one (sorry, it is in Delphi, but it can be translated to C++).

I can tell you right now, though, that FireMonkey's TBitmap class DOES NOT work correctly outside of the main UI thread. There are many open bug tickets about that. So, you could certainly download the images in a background thread, but you would end up doing a lot of synchronizing with the UI thread in order to load them into the UI.

Hi.Set StylesData should solve the problem.As I understand it is necessary to replace the line:ListBoxItem->ItemData->Bitmap->LoadFromStream(WelcomeINI.get());something like this:ListBoxItem->StylesData["ItemData.Bitmap"] = TValue::From<TMemoryStream>(WelcomeINI.get());but this is not the correct code.Please show me how to set StylesData a picture from a TMemoryStream.

Lena wrote:Set StylesData should solve the problem.As I understand it is necessary to replace the line:ListBoxItem->ItemData->Bitmap->LoadFromStream(WelcomeINI.get());something like this:ListBoxItem->StylesData["ItemData.Bitmap"] = TValue::From<TMemoryStream>(WelcomeINI.get());but this is not the correct code.Please show me how to set StylesData a picture from a TMemoryStream.

StylesData[] returns a TValue, so I would expect it to return a TBitmap object pointer in this situation:

Your anonymous thread is not synchronizing with the main UI thread when accessing the ListBoxItem. You MUST synchronize. Not only because it is the right thing to do in general (you can't access UI controls across thread boundaries, especially on Android), but also because FireMonkey's TBitmap class is not thread-safe, it can only be used safely in the main UI thread (there are numerous bug reports in Quality Portal about this issue).

Lena wrote:I set a breakpoint on line and I see an empty bitmap:TBitmap *bitmap = value.AsType<TBitmap*>(); //breakpoint does not work

After that I see the pictures on the ListBox but only after scrolling.

That is likely related to you accessing the ListBoxItem and Bitmap from outside of the main UI thread. Sync with the main UI thread when loading the Bitmap, and see if it redraws correctly. If not, try calling ListBoxItem->InvalidateRect() or ListBoxItem->Repaint() after loading the bitmap.