Results 1 to 3 of 3

Thread: Activate control

  1. #1

    Thread Starter
    Hyperactive Member noble's Avatar
    Join Date
    Nov 2000
    Location
    Philly
    Posts
    471
    I have a control which i created which is activated
    based on a boolean property. What is the best way
    to monitor this property so that my control will be
    activated?

    thx for any help
    Bababooey
    Tatatoothy
    Mamamonkey

  2. #2
    Member
    Join Date
    Nov 2000
    Location
    Manila, Philippines
    Posts
    51
    2 ways:

    1.> You make a property called, (for example) "IsActivated" which would accept and return boolean values. Then call the code that will activate your control on the property procedure that "sets" the boolean value. For example:


    Public Property Let IsActivated(ByVal pb_Activate As Boolean)

    YourLocalVariable = pb_Activate
    If pb_Activate = True Then
    Call ProcedureForActivatingMyControl()
    End If
    End Property


    2.> Or, you can simply put a public method on your control to Deactivate/Activate it: (Here is an example)


    Public Function ActivateMyControl() As Boolean
    On Error Goto Hell

    'do activation code here...
    blah blah blah....

    ActivateMyControl = True
    Exit Function
    Hell:
    ActivatemyControl = False
    End Function

    Public Function DeactivateMyControl() As Boolean
    'do as above... except, do the deactivation code here...
    End Function


    NOTE: If you are asking what is the best, my answer would be to make a public method to activate or deactivate the control. (I hate properties )

    Hope that helps
    Programmers dont byte, they just nibble a bit.

  3. #3

    Thread Starter
    Hyperactive Member noble's Avatar
    Join Date
    Nov 2000
    Location
    Philly
    Posts
    471
    ty, that is waht i have done
    I would like to steer away from calling a procedure as
    my control will be working as long as it's activated and
    i dont want to eat up unecessary processor time.

    I decided to enable a timer when the flag is set to true
    which handles my control

    thx for the help.
    Bababooey
    Tatatoothy
    Mamamonkey

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