Access 2003 - Line segments on a form

A

arrkle

I am recreating a puzzle found in a book.
The form uses 72 line segments to build a particular geometric pattern (not
a maze) - and it works exactly as intended.
I used the Tool Box to put one line on the form, then made 71 copies of it.
The result, of course, is 72 separate Line controls.


Is there a way to DYNAMICALLY CREATE the line segments (i.e. the controls)?
OR, can I put one line segment on the form and DYNAMICALLY COPY it 71 times?
I have searched reference books AND the web but haven't yet found a way to
do it.

Can you help (preferably without using ADO)?
 
M

Marshall Barton

arrkle said:
I am recreating a puzzle found in a book.
The form uses 72 line segments to build a particular geometric pattern (not
a maze) - and it works exactly as intended.
I used the Tool Box to put one line on the form, then made 71 copies of it.
The result, of course, is 72 separate Line controls.


Is there a way to DYNAMICALLY CREATE the line segments (i.e. the controls)?
OR, can I put one line segment on the form and DYNAMICALLY COPY it 71 times?
I have searched reference books AND the web but haven't yet found a way to
do it.


No. Creating new controls is structky a design time
operation. The CreateControl method can do it (only in
design view), but it is intended only for creating wizard
type design helper procedures, not something to be done in a
running app.

The standard way to deal with a situation where you don't
know a priori how many controls you will need is to
precreate (in design virew) more than a sufficient number of
invisible controls in the appropriate section. Then, at
runtime, make the ones you want to use visible and adjust
their top, left, etc. properties.
 
A

arrkle

Marshall,

Thanks for the help!

CreateControl is exactly what I was looking for -- and I have made it work.
Now all I have to do is tweak the positioning a little bit.

Thanks again,
Arrkle
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top