Click here to Skip to main content
15,949,686 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello friends

i am trying to change opacity of button in vb.net.....


but i couldn't find any properties like opacity.. how can i change opacity

of program can anyone tell me....
Posted

For the button Set the UseVisibleStyleBackColor = False
Suppose the button name is "changeBatchLocationBtn"

Then in the load event of the form set the opacity using the below given code.

C#
Color col = changeBatchLocationBtn.BackColor;
changeBatchLocationBtn.BackColor = Color.FromArgb(50, col.R, col.G, col.B);


--------------------------------
The 1st parameter for the FromArgb method decides the opacity. Lower value gives low opacity and higher value gives high opacity.
--------------------------------

Refer link for reference.

http://stackoverflow.com/questions/1751914/opacity-of-buttons-textboxes-vb-net[^]

-- Bhushan Deshmukh
(Note : if you find the answer helpful plz provide appropriate vote on the top right corner.)
 
Share this answer
 
v3
A button does not support any opacity property.

See here[^] for an alternative.
 
Share this answer
 
You CANNOT use such options(like partial opacity/custom shape/shadowing) unless you are using WPF(simply because WInFOrms uses GDI+, that has very poor power in creating non-standart elements(non-standart mean non-rectangular and non-windows-like).If you like,you can check with API functions, but it definetly will not provide best solution.As an alternative try finding controls of other firms
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900