Transparent button no longer work

I have a great app that I really like that has transparent buttons on a transparent form background, so all you see is the button boder and text over you desktop.

On .Net 1.1 this worked great. Now that I have upgraded the app to C# 2005 and .NET 2.0 I noticed that many times when I hit a button it does nothing!

The button only gets the click event if the exact tip of the cursor is exactly on a visible pixel, not just inside the button anymore.

This makes favorite app virtually useless!

Does anybvody know anything I can do about his

Tim



Answer this question

Transparent button no longer work

  • Cosmo69

    Yes I wrote it myself in VS 2003 (C#).

    The form's transparency key is 'steel blue'.

    The form background color is 'steel blue'.

    The buttons' background colors are 'steel blue'. I've tried a background color of 'transparent' also.

    I then loaded the app in VS 2005 and let in convert.

    Yes, this is always true that if I click a transparent area on the button it does not do anything, and if I click with the curor tip exactly on a visible pixel does always work.

    In my experimenting I find that labels have the same issue, and other events besides click, such as 'mousedown' also don't work on transparent parts of the button or label.

    By the way, just to be sure, I loaded and ran a back-up copy of the .NET 1.1 version and saw that it worked correctly. And then loaded it in VS 2005 and let it convert with NO other changes to the code, and this problem started. So the upgrade to 2005 and .NET 2.0 is definitely the only difference.

    Thanks,

    Tim


  • MeToo

    Oops,

    Two more details that I forgot to mention:

    The buttons are all flatstyle 'flat' with flatstyle 'mouseoverbackstyle' of transparent.

    This seems to be the key! I just discovered that if I change the 'mouseoverbackstyle' to anything other than transparent, the button works!

    I liked it better the old way, but I can live with this. I still don't know what to do about labels, but I only have one or two labels that I have click events for.

    Thanks,

    Tim


  • Rohnish

    I think you should try to give us more specific information on your specific problem.

    Did you write the app yourself Did you rebuilt in when you got VS 2005 What technique is used to make the buttons and the forms transparent When you click a button does it never get clicked when not on a visible pixel or only sometimes



  • Transparent button no longer work