Oh, and under this 'feature', Me(1) would give you the 2nd item of
the array, Me(2) the 3rd, and so on... There's just gotta be a nifty
use for such a feature :)
On May 9, 2006, at 9:15 PM, William Squires wrote:
Is there an 'official' (or even unofficial) way for code in a
control to determine if said control is part of a control array? (i.e.
it has a non-empty 'Index' value in the properties window of the IDE).
If not, is there a feature request for it?
I'm thinking something like a new syntax for 'Me' as in:
Sub Action(???)
// Assumes we're a PushButton
Dim dummy As PushButton
Try
// If we're a control in a control array, Me(0) will return a
reference to the control in the array
// whose Index=0 (which should always work if we are - in fact - a
control in a control array!) If
// not, this'll throw an OutOfBoundsException.
dummy = Me(0)
MsgBox "Is part of a control array."
Catch ex As RuntimeException
MsgBox "Not part of a control array."
End Try
End Sub
This could be used to make a radio button (or checkbox) subclass
that could detect if it's the only one of its kind. For example, a
radio button that - if not part of a control array - will set its own
value to True and disable itself. If part of a control array, though,
it would do nothing special unless all the other instances of the
control array have Visible=False, in which case, it'll act as if it
weren't part of a control array!
??? -> We don't know if 'Index As Integer' is one of the arguments to
the sub/function in question.
William H Squires Jr
4400 Horizon Hill #4006
San Antonio, TX 78229
[EMAIL PROTECTED] <- remove the .nospam
William H Squires Jr
4400 Horizon Hill #4006
San Antonio, TX 78229
[EMAIL PROTECTED] <- remove the .nospam
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>