Czy ktoś pomoże mi to uporządkować, bo ja nie daję rady. Chciałem zrobić w ten sposób. Podczas projektowania umieściłem na Form1 Panel2. A dynamicznie chcę tworzyć Panel3 wewnątrz Panel2, oraz Image2 na Panel3. No i tu pojawia się problem, jak to zrobić? Chcę umieścić dlatego Panel3 wewnątrz Panel2 , żeby wizualnie ładnie to wyglądało i można było ewentualnie zastosować paski przewijania. Wszystko niby jest tworzone, ale za cholere nie mogę wyświetlić obrazka w Image2 tworzonym dynamicznie.
void __fastcall TForm1::FileListBox1Change(TObject *Sender)
Graphics::TBitmap *bmp = new Graphics::TBitmap;
TPanel *Panel3;
Panel3 = new TPanel(this);
Panel3->Parent = Panel2;
Panel3->Left = 15 ;
Panel3->Top = 400;
Panel3->Width = 30;
Panel3->Height = 30;
Panel3->Show();
TImage *Image2;
Image2 = new TImage(this);
Image2->Parent = Panel3;
Image2->Left = 15;
Image2->Top = 400;
Image2->Width = 30;
Image2->Height = 30;
Image2->Show();
bmp->LoadFromFile(FileListBox1->FileName);
Image2->Picture->Bitmap->LoadFromFile(FileListBox1->FileName);
Image2->Canvas->Brush->Bitmap = bmp;
Image2->Canvas->FillRect(Rect(15, 400, Image2->Width, Image2->Height));
Image2->Stretch = true;
}