I want to draw on the TPanel in C++Builder

545 Views Asked by At

I dynamically add several TImage controls to a TPanel, and want to draw lines between them, but TPanel does not have Canvas. You can draw on a TPaintBox, but I cannot use TImage smiles on it. Tell me how to get out of this simple situation.

1

There are 1 best solutions below

1
Dan49 On

I have dealt with this issue

// before describing the form class in the h-file:
namespace CanvasPanel
{
    class TPanel : public Extctrls::TPanel
    {
    public:
        __property Canvas;
    };
}
#define TPanel CanvasPanel::TPanel
 
// next - the form class, and everything is unchanged...
class TForm1 : public TForm