But why would I need control arrays if i have controls addressable by
name :-)
if I know that radiobutton1 and radiobutton2 need to be checked
against each other I just retrieve those two from the ControlDict
Bart
On 7-mei-07, at 18:16, Arnaud Nicolet wrote:
> I think you may have troubles with control arrays.
>
> Le 7 mai 07 à 11:10 Matin, Bart Pietercil a écrit:
>
>> Still feeling a bit green in RB to participate in discussions (for
>> the time being I prefer learning by lurking) like this but what is
>> wrong with this?
>>
>>
>> on Windowlevel create a Dictionary ControlDict
>>
>> In the windows open event
>>
>> Dim i as Integer
>>
>> ControlDict = new Dictionary
>>
>> For i = 0 to Self.ControlCount-1
>> ControlDict.Value(Self.control(i).name) = Self.control(i)
>> Next
>>
>> you can modify this in order to store more info about the control
>> into the Dict like this
>>
>> Dim i as integer
>>
>> ControlDict = new Dictionary
>>
>> For i = 0 to Self.ControlCount-1
>> Dim aDict as new Dictionary
>> Select Case True
>> case Self.control(i) isa Editfield
>> aDict.Value("controlType") = "Editfield"
>> case ......
>>
>> end Select
>> aDict.Value("control") = Self.Control(i)
>> ControlDict.Value(Self.control(i).name) = aDict
>> Next
>>
>>
>> From now on I can retrieve any control by name
>> (using example 1)
>>
>> Dim aControl as Editfield
>>
>> aControl = ControlDict.Value("editfield1")
>>
>> aControl.Text = aControl.name
>>
>> UNTESTED "mail-code"
>>
>> just to communicate the idea
>>
>>
>> I most certainly would like to know what the disadvantages are of
>> this approach
>>
>>
>> Bart Pietercil
>>
>>
>>
>> On 7-mei-07, at 10:47, Dirk Cleenwerck wrote:
>>
>>>
>>>
>>> Giovanni schreef:
>>>> Is there a list of the controls i can see what controls are on the
>>>> form
>>>> while on the IDE?
>>>>
>>>> thanks,
>>>>
>>>> giovanni
>>> _______________________________________________
>>>
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>