Results 1 to 8 of 8
  1. #1
    2 Star Lounger
    Join Date
    Apr 2001
    Location
    Wellington, New Zealand
    Posts
    173
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Usercontrol Visible property alwasys returns false (VB 6 SP5)

    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

  2. #2
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Usercontrol Visible property alwasys returns false (VB 6 SP5)

    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.
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  3. #3
    2 Star Lounger
    Join Date
    Apr 2001
    Location
    Wellington, New Zealand
    Posts
    173
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Usercontrol Visible property alwasys returns false (VB 6 SP5)

    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.

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Usercontrol Visible property alwasys returns false (VB 6 SP5)

    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". <img src=/S/shrug.gif border=0 alt=shrug width=39 height=15>
    Charlotte

  5. #5
    2 Star Lounger
    Join Date
    Apr 2001
    Location
    Wellington, New Zealand
    Posts
    173
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Usercontrol Visible property alwasys returns f

    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?

  6. #6
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Usercontrol Visible property alwasys returns f

    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?
    Charlotte

  7. #7
    2 Star Lounger
    Join Date
    Apr 2001
    Location
    Wellington, New Zealand
    Posts
    173
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Usercontrol Visible property alwasys returns f

    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).

  8. #8
    Silver Lounger
    Join Date
    Mar 2001
    Location
    Springfield, Ohio, USA
    Posts
    2,136
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Usercontrol Visible property alwasys returns f

    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
    Attached Files Attached Files
    <font face="Comic Sans MS">Sam Barrett, CACI </font face=comic>
    <small>And the things that you have heard... commit these to faithful men who will be able to teach others also. 2 Timothy 2:2</small>

Posting Permissions

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