richasr1 0 Newbie Poster

Hey,

I've been using c++ builder and ive hit a snag.

I'm creating a very simple program that will allow you to manipulate shapes; each shape has the same mousedown properties as every other shape.

What i want to do next is to use a settings dialogue box to set the number of shapes created when the form is run, bearing in mind that each created shape must have the same functionality as every other shape.

Heres a snippet of code inside the buttons click event, all this does is create the shape and assign it to a group box, there's other code to position the new shape next to existing shapes which is unnecessary here i think:

TShape* shpNew;
shape = new TShape(this);
shape->Parent = mainGrp;

//set all the appearance properties
shape->Shape = stRectangle;
shape->Brush->Color = clRed;
shape->Width = 33;
shape->Height = 33;
shape->Left = 10;
shape->Top = 10;

I'm not sure how i would go about creating multiple shapes, let alone creating them based on a pre-set number.

help would be much appreciated, thanks in advance.

Steve.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.