|
-
Jan 22nd, 2002, 05:14 PM
#1
Thread Starter
Addicted Member
Active-X Control with arrays
Hi Guys,
I'm bit confused here and i would really appreciate some help.
I have no problem developing Active-X controls but never had to use Arrays.
Let's suppose i have an Active-X calendar that have 100 textbox
(text1(0), text1(1), etc.)
Usualy when exposing the properties i did the following :
Public Property Get Day_Width() As Integer
Day_Width = m_Day_Width
End Property
Public Property Let Day_Width(ByVal New_Day_Width As Integer)
m_Day_Width = New_Day_Width
PropertyChanged "Day_Width"
End Property
Now, that i have 100 textbox, how shall i do it (exposing its properties, UserControl_WriteProperties, UserControl_ReadProperties, etc.)
Thanks for any idea
-
Jan 22nd, 2002, 10:40 PM
#2
Fanatic Member
Seems to me you could use the grid analogy. The cells (textboxes) start as one entity with one set of properties/values (width, height etc). You'd have other user control properties that define number of rows, cols, color, rowheight, etc. Based on that info, the user control dynamically loads the textbox control array into proper position and assigns each the appropriate textbox property values.
VB 6.0, Access, Sql server, Asp
-
Jan 23rd, 2002, 02:36 AM
#3
Thread Starter
Addicted Member
Great but how ?
How to expose the properties of all these textboxes for the user to access them (i'm tlking here about 100 textboxes) - Usually in the normal cases i had no problem (meaning i didn't have to work with indexes before in Active-X controls)
-
Jan 23rd, 2002, 11:16 AM
#4
Fanatic Member
Controls that have very similar functionality or share properties are grouped as part of a control array. If they are on the UserControl at design time, you can map the properties to them the same way in ReadProperties/WriteProperties but you simply use a loop:
for i = 0 to x
PropBag.WriteProperty "m_Whatever_Width", TextBox(i).Width, 800
Next
Those controls that have unique properties are mapped without the loop
PropBag.WriteProperty "m_Unique_Width", TextBox(SomeIndex).Width, 800
VB 6.0, Access, Sql server, Asp
-
Jan 23rd, 2002, 12:12 PM
#5
Thread Starter
Addicted Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|