Dan49
Dan49

Reputation: 21

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

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.

Upvotes: 0

Views: 748

Answers (1)

Dan49
Dan49

Reputation: 21

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

Upvotes: 1

Related Questions