Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create a Control in RUN-MODE??

Status
Not open for further replies.

MrVB50au

Programmer
Mar 16, 2003
326
AU
Hi Everyone,

Is it possible to create a control and it's arrays on the form in Run-mode?


FOR EXAMPLE:

In Design-mode I had created a Label1(0) and set it's visibility to false

In Run-mode, I had created Label1(1), Label1(2) and so on.

Now, still in run-mode, I want Label1(2) to have a shadow effect so I need to create an array of controls in run-mode to produce this ( eg: ShadowLabel(0) ). But I only want it to be owned by Label1(2) control and no other. Like, if I created Label1(8) but itself had it's own shadow reference if I need to give it a shadowing effect. (Incrementing from 1 to 25 copies of shadow depth for each when and if required).


I hope I make sence,

Just thinking if this was possible and if so, I will need to create it and name it all in run-mode.


Thanks so much for your help, very much valued.

Andrew.
 
you can create Label1(0), label2(0)
then you can
for lblcounter=1 to 25
load label1(lblcounter)
label1(lblcounter).visible=true
label1(lblcounter).left=lblcounter
label1(lblcounter).top=lblbcounter
next lblcounter

if you got more labels live label2 then the same but with label2

for lblcounter=1 to 25
load label2(lblcounter)
label2(lblcounter).visible=true
label2(lblcounter).left=lblcounter
label2(lblcounter).top=lblbcounter
next lblcounter

and so on
hope it helps.
 
ok, if i can create a label control in runmode, without it ever being on the form at designmode, how will I go about this please?

 

you can use the controls collection and add new items to it at runtime which will also allow you to add new controls on the fly without it ever being on the form at designmode.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top