Opacity of Buttons/TextBoxes - VB.NET

22,971

There is no way to set the opacity of any control in WinForms. Only Forms have the opacity property. If you want to make any control appear semi-transparent, you'll have to implement the whole control from scratch and that will most likely involve drawing the control as an image onto its parent.

Your alternative is to use WPF, which allows setting the opacity of controls.

Share:
22,971
lab12
Author by

lab12

Updated on August 29, 2020

Comments

  • lab12
    lab12 over 3 years

    Is it possible to set the opacity of a button or textbox? I know that you can set the opacity for a form, but I'm not so sure about a button or textbox.

  • lab12
    lab12 over 14 years
    WHere is RGBA on Visual Basic 2008 ?
  • Victor Zakharov
    Victor Zakharov over 11 years
    This approach does not work. Varying alpha (first parameter) does not make a difference. Tested on a button over a listbox.
  • Victor Zakharov
    Victor Zakharov over 11 years
    I think OP was referring to Winforms.
  • Victor Zakharov
    Victor Zakharov over 11 years
    Opacity is not the same as Transparency.
  • Dman
    Dman over 8 years
    He doesn't want it transparent, just change the opacity