Board index » cppbuilder » Dynamically creating a TImage object on a Form?

Dynamically creating a TImage object on a Form?

How do you dynamically create TImage object on a Form?  I cannot seem to get
the TImage object to appear on the form.  This is a snippet from the
FormCreate() method:

      pImage = new TImage(this);
      pImage->BringToFront();
      pImage->Enabled = true;
      pImage->Height = 75;
      pImage->Width = 75 ;
      pImage->Visible = true ;
      pImage->Top = nTopPos;
      pImage->Left = nLeftPos;
Where pImage is defined in the header file as TImage* pImage ;

There is something I am missing....   Thanx

 

Re:Dynamically creating a TImage object on a Form?


Yes, you are missing something...

You need to set the Parent property as well
    pImage->Parent = this;

Gambit

"Robert H. Oujesky" <rouje...@mylinuxisp.com> wrote in message
news:3aa1b871_1@dnews...

Quote
> There is something I am missing....   Thanx

Re:Dynamically creating a TImage object on a Form?


Wow, that was a fast response!  Thanx so much.  That did the trick.  I
really do appreciate all the help.  I am sloooooowly learning BCB.

Quote
"Remy Lebeau" <gambi...@gte.net> wrote in message

news:97seck$p7g3@bornews.inprise.com...
Quote
> Yes, you are missing something...

> You need to set the Parent property as well
>     pImage->Parent = this;

> Gambit

> "Robert H. Oujesky" <rouje...@mylinuxisp.com> wrote in message
> news:3aa1b871_1@dnews...

> > There is something I am missing....   Thanx

Other Threads