Thread View: pl.comp.lang.vbasic
2 messages
2 total messages
Started by avi
Tue, 02 Feb 2010 12:58
Creating a collection of ActiveX objects
Author: avi
Date: Tue, 02 Feb 2010 12:58
Date: Tue, 02 Feb 2010 12:58
12 lines
1619 bytes
1619 bytes
Hello, Certainly a basic question I have a form with 20 objects of the same type (an ActiveX gauge called CircleGauge1, CircleGauge2,....). In order to refer to them I understand that I have to define them as a collection (or array?) How do I accomplish that? Thanks for your patience Avi
Re: Creating a collection of ActiveX objects
Author: Janusz Rychter
Date: Wed, 03 Feb 2010 13:22
Date: Wed, 03 Feb 2010 13:22
34 lines
2488 bytes
2488 bytes
The simplest way is to select control and then use COPY/PASTE. When control is pasted, you will be asked if you like to create control array. Click YES and repeat COPY/PASTE operation as many times as you need to. Check INDEX property of the control, you will need to use this property in order to access each control in the array. Another way is to drop control on the form and in properties set INDEX to 0 (zero). Now COPY/PASTE the control and VB will generate array automatically for you. You can refer to each control in the array using something like this (I'm not sure if your gauge control has Visible property): Dim i as integer For i = 0 to CircleGauge1.Count - 1 CircleGauge1(i).Visible = Fasle Next i jr On Feb 2, 7:58 am, avi <avi...@bezeqint.net.il> wrote: > Hello, > > Certainly a basic question > > I have a form with 20 objects of the same type (an ActiveX gauge > called CircleGauge1, CircleGauge2,....). In order to refer to them I > understand that I have to define them as a collection (or array?) > > How do I accomplish that? > > Thanks for your patience > Avi
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads