Link to home
Start Free TrialLog in
Avatar of simonwait
simonwaitFlag for United Kingdom of Great Britain and Northern Ireland

asked on

VB6 control cant set visible property at runtime

Hi

I have a usercontrol which I would like to run the following code on but although if I click on an instance on the form I am able to set the visible property I dont seem to be able to at runtime.  if I do me. then visible isnt one of the options.  ASONText is a property created and put into the propertybag.

      
If Left(Me.ASOnText, 9) = "Condition" Then
    Me.Visible = False
else
   Me.Visible = True
End If

Open in new window

Avatar of HooKooDooKu
HooKooDooKu

Assuming a 'Visible' property exists for the usercontrol, it might have been declared as 'Private'.  If so, they you can not access the property using 'Me'.  Simply access the property directly.
If Left(Me.AsOnText, 9) = "Condition" Then
    Visible = False
Else
    Visible = True
End If

Open in new window

Are you trying to make the usercontrol visible or are you trying to make the form visible?
Avatar of simonwait

ASKER

Im trying to control the usercontrol visibility.  I assume that although I can set this if I click on the usercontrol and select from the options in the properties window that it does exist.  However if im wrong is there a way for me to create it?
You might take a look at my NumberBox ActiveX control to see if it's of any help.

It's been a while since I wrote a user control so I don't know if this would help but do you have the Visible property in the property bag?
ASKER CERTIFIED SOLUTION
Avatar of HooKooDooKu
HooKooDooKu

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial