Results 1 to 6 of 6
  1. #1
    Bronze Lounger
    Join Date
    Feb 2001
    Location
    Escondido, California, USA
    Posts
    1,458
    Thanks
    0
    Thanked 1 Time in 1 Post

    Transparent Command Button? (VB 6)

    Is there any way to make a command button transparent so that the background (in this case a picture) shows through? Then clicking anywere inside the "invisible" button causes the on-click event.

    I though I could simply make the visible property false but keep it enabled and it would work. However, it seems that when you make it invisible it is no longer enabled. It would be nice if they were separate properties.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 28 Times in 28 Posts

    Re: Transparent Command Button? (VB 6)

    You could use a label with BackStyle set to Transparent instead of a command button. A label has an On Click event, just like a command button.

  3. #3
    Bronze Lounger
    Join Date
    Feb 2001
    Location
    Escondido, California, USA
    Posts
    1,458
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Transparent Command Button? (VB 6)

    Thanks Hans,

    I tried it with a command button and text box, but neither has the transparent option -- didin't think of trying a label, but it works like a champ!

  4. #4
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Transparent Command Button? (VB 6)

    Don't know if it suits your purpose, but an image control itself has click and double-click events. Perhaps you could do away with a "button" altogether?

    Alan

  5. #5
    Bronze Lounger
    Join Date
    Feb 2001
    Location
    Escondido, California, USA
    Posts
    1,458
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Transparent Command Button? (VB 6)

    I've used that before, but in this case the control title was incorporated into the background picture, so I needed to overlay a transparent
    control.

    Thanks

  6. #6
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Transparent Command Button? (VB 6)

    OK, now comprendi <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

    Alan

Posting Permissions

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