Runtime Create Controled Array

Runtime Create Controled Array

Anonymous
Not applicable
470 Views
6 Replies
Message 1 of 7

Runtime Create Controled Array

Anonymous
Not applicable
I have some code that create a few textbox controls at runtime and I am
looking to use one procedure to control events to each. I am looking to
create them in a controlled array but I can't seem to find infor on this on
MSDN. What key words should I be looking up to get help on this. Anyone
know of a place I can look at some help?

TIA

--
Rob Starz
| president / dreamer | director
--------------------------------------------------
| Stardsign cad solutions | Autodrop , llc
| 352.263.3786 | www.autodrop.net

| AEC Designer / Consultant / Developer
| Autodesk Architectural Desktop:
Tools: www.stardsign.com
Tech Support: www.stardsign.com/support.htm
Bring the power of i-drop into AutoCAD with i-dock
(www.stardsign.com/idock.htm)
0 Likes
471 Views
6 Replies
Replies (6)
Message 2 of 7

Anonymous
Not applicable
Found it.

Thanks anyway.

--
Rob Starz
| president / dreamer | director
--------------------------------------------------
| Stardsign cad solutions | Autodrop , llc
| 352.263.3786 | www.autodrop.net

| AEC Designer / Consultant / Developer
| Autodesk Architectural Desktop:
Tools: www.stardsign.com
Tech Support: www.stardsign.com/support.htm
Bring the power of i-drop into AutoCAD with i-dock
(www.stardsign.com/idock.htm)
0 Likes
Message 3 of 7

Anonymous
Not applicable
Rob,

I thought that VBA did not support control arrays?

Chris
"Rob Starz" wrote in message
news:[email protected]...
> Found it.
>
> Thanks anyway.
>
> --
> Rob Starz
> | president / dreamer | director
> --------------------------------------------------
> | Stardsign cad solutions | Autodrop , llc
> | 352.263.3786 | www.autodrop.net
>
> | AEC Designer / Consultant / Developer
> | Autodesk Architectural Desktop:
> Tools: www.stardsign.com
> Tech Support: www.stardsign.com/support.htm
> Bring the power of i-drop into AutoCAD with i-dock
> (www.stardsign.com/idock.htm)
>
>
0 Likes
Message 4 of 7

Anonymous
Not applicable
I am using VB

--
Rob Starz
| president / dreamer | director
--------------------------------------------------
| Stardsign cad solutions | Autodrop , llc
| 352.263.3786 | www.autodrop.net

| AEC Designer / Consultant / Developer
| Autodesk Architectural Desktop:
Tools: www.stardsign.com
Tech Support: www.stardsign.com/support.htm
Bring the power of i-drop into AutoCAD with i-dock
(www.stardsign.com/idock.htm)
0 Likes
Message 5 of 7

Anonymous
Not applicable
Rob,
I was looking for how to do this for the longest time. (add controls at
runtime) The only thing I could find was adding 3rd party controls, not
built in ones like textboxes or com buttons. Can you direct me to the help
that explained how to do what your'e doing or share a little code snippet if
you don't mind?
Thanks either way,
Mark

"Rob Starz" wrote in message
news:[email protected]...
> I have some code that create a few textbox controls at runtime and I am
0 Likes
Message 6 of 7

Anonymous
Not applicable
I did a search on google for this and I waded through tons of posts.
It is rather simple once you get the control created.
As per MSDN it says that creating array controls at runtime helps load the
form faster than having them in the form already .

In order to do this you must have on object of the same type already on the
form. Set this controls index to 0 (or what ever number you want).

Create the control...lets say TextBox with a name of MyTextBox and set the
index to 0
Now in the form load area use

Dim objTextBox As TextBox 'declare the textbox object variable
Load MyTextBox (1) 'add another index control to the textbox.
Set objTextBox = MyTextBox (1) ' set the objTextBox to the new control
'''since this new control is sitting right on top of the master control
you need to modify some things.
with objTextBox
.visible = true
.top = MyTextBox(0).top + MyTextBox(0).height 'set the height to
sit underneath the first control
.text = "This is a test"
end wth

ALL DONE. Pretty simple once you get the index stuff.

I am createing arrayed text boxes bases on a return ubound of a list. and it
that requires looping and making each control.

I hope this helps and I didn't mispell anything since I just took this from
memory.

--
Rob Starz
| president / dreamer | director
--------------------------------------------------
| Stardsign cad solutions | Autodrop , llc
| 352.263.3786 | www.autodrop.net

| AEC Designer / Consultant / Developer
| Autodesk Architectural Desktop:
Tools: www.stardsign.com
Tech Support: www.stardsign.com/support.htm
Bring the power of i-drop into AutoCAD with i-dock
(www.stardsign.com/idock.htm)
0 Likes
Message 7 of 7

Anonymous
Not applicable
Rob,

great! Thanks for the explanation, I'm sure I went that same search route,
just didn't find the right ton I guess.
I'll dig into this as soon as I dig down to the bottom of this urgent
production pile...:(
Mark
0 Likes