Button Opacity / TextBoxes - VB.NET

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

+5
source share
8 answers

It is not possible to set the opacity of any control in WinForms. Only forms have the opacity property. If you want a control to look translucent, you will need to implement the entire control from scratch, and this will most likely require you to draw the control as an image for its parent.

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

+1
source

Just set the Alpha level in the RGBA setting for the color of the control. The code will look something like this:

Control.Backcolor = Color.FromArgb(255, 255, 255, 255)

The first value passed to the FromArgb method is Alpha. A high value will mean high opacity, while a low value will mean high transparency. You may also need to set the Forecolor property of the control if you also want it to be transparent.

0
source

, , . , , "", , , .

0

, , TransparencyKey (: Fuchsia), Fuchsia. .

0
<asp:ImageButton ID="avbtn" runat="server" Height="55px" 
ImageUrl="~/images/avatar.jpg"                                             
onmouseout="this.style.opacity=0.7;this.filters.alpha.opacity=40" 
onmouseover="this.style.opacity=1;this.filters.alpha.opacity=100" 
style="opacity:0.4;filter:alpha(opacity=40)" />

ImageButton, .

0

, , .

0

, ( ) Photoshop, . , ( ), , . :

0

A simple way: select the random color of the text field that you want to make transparent by going to the -backcolor-any property. Then go to the source and find the color code of the selected color and write transparent, and you're done. Example:

<asp:TextBox ID="TextBox1" 
 runat="server" **BackColor="transparent"** Height="55px" Width="498px"> </asp:Textbox>  

The same goes for VB. Hurrah!!!

-1
source

All Articles