• Usercontrol Visible property alwasys returns false (VB 6 SP5)

    Home » Forums » AskWoody support » Productivity software by function » Visual Basic for Applications » Usercontrol Visible property alwasys returns false (VB 6 SP5)

    Author
    Topic
    #382747

    Has anyone else experienced this:

    I am using a usercontrol on a form in VB. The usercontrol (name ctlSheet1) has it’s visible property set to TRUE:

    me.ctlSheet1.visible = true

    However, directly after I do this, although the usercontrol is displayed, FALSE is returned from the usercontrol.

    Has anyone an explanation / solution.

    Cheers

    Viewing 1 reply thread
    Author
    Replies
    • #650072

      I wonder if this happens if the .xls is read only or the project is locked with a password
      making it read only. Only thing I can think of.

      • #650086

        This has nothing to do with MS Excel. I am using VB6. The usercontrol is named ctlSheet1 (which you may have mistaken for something from Excel?).

        There is not password and no read-only files.

    • #650225

      What is a usercontrol? There are all sorts of control in VB and dozens you can add. I’ve never run across one called simply “usercontrol”. shrug

      • #650245

        In your VB project explorer, right click the project and choose add –> user control.

        Select ‘User Contro’ and click OK, a new user control is added to your project.

        This may also be referred to as another name?

        • #650248

          Ah, I see. You’re creating an activex control, right? I never do that, so I had forgotten about the usercontrol object. Are you testing the visibility of a control *on* the usercontrol or the usercontrol itself?

          • #650251

            Yeah, except it isn’t a stand alone ocx, or dll or anything, rather it is just part of the VB project as a User Control object.

            I am testing the Usercontrol / ActiveX control’s visible property (ie. not a constituent control on the Usercontrol).

            • #650266

              The Visible property of a User Control should work fine. I’ve attached a zipped simple project that uses the Visible property. Just unzip, double click the Group1.vbg, and press the Start button. HTH –Sam

    Viewing 1 reply thread
    Reply To: Usercontrol Visible property alwasys returns false (VB 6 SP5)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: