Board index » cppbuilder » TShape sh=new TShape(Form1) doesn`t work

TShape sh=new TShape(Form1) doesn`t work

sh is invisible because there is now canvas,how can i create canvas for
TShape object ?

Thanks

 

Re:TShape sh=new TShape(Form1) doesn`t work


Albel <alberta...@elsis.com> az albbiakat rta a k?vetkez? hrzenetben:
8bs80b$...@bornews.borland.com...

Quote
> sh is invisible because there is now canvas,how can i create canvas for
> TShape object ?

> Thanks

Try:

TShape *sh = new TShape(Form1);

Bye.

Gy?rgy

Re:TShape sh=new TShape(Form1) doesn`t work


Hi Albel,

Quote
> sh is invisible because there is now canvas,how can i create canvas for
> TShape object ?

Before any TGraphicControl descendant can be displayed, it needs to have a valid
windowed control assigned to is Parent property.  This is simply due to the fact
that TGraphicControls render themselves to the device context of their Parent...
TShape *MyShape = new TShape(Form1);
MyShape->Parent = Form1;

Good luck!

--
Damon Chandler (TeamB)
http://bcbcaq.freeservers.com

Other Threads