Results 1 to 4 of 4

Thread: control array and classes

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2000
    Location
    Posts
    6
    I'm not sure how to explain with words, so let me put the code down and maybe someone out there can explain why it doesn't work.

    'from class1
    Private WithEvents txt As TextBox
    Public Property Set TextBoxCtl(OutsideTextBox As TextBox)
    Set txt = OutsideTextBox
    End Property

    'in the main form
    Private textcontrol as class1
    Set textcontrol = new class1
    Set textcontrol.TextBoxCtl = Text1(0)
    'Text1(0) being part of a control array

    When I run I get the error "Object or class does not support that set of events"

    I'm rather new at this and completely baffled.

  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    I'm not sure, but it could be the array of Text1 raises events with a index argument, and you don't have those in your class1. Have you tested with a textbox that is not in an array?
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  3. #3

    Thread Starter
    New Member
    Join Date
    Jul 2000
    Location
    Posts
    6
    It works fine for single text boxes. How could I change the TextBoxCtl property to an array of controls? I've tried a few things, (changing the argument "outsidetextbox" to an array, changing the storage var "txt" to an array, adding and Index param to the txt_Change and txt_KeyPress events) but they all raise errors.

  4. #4
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    I guess there is no way out, just if you didn't make the control an array, and instead make a reference array with all the textboxes references inside
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width