Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I change Control's Opacity?

Tags:

I want to change controls opacity depending on the mouse position on the form, is this possible?

like image 447
Luiscencio Avatar asked Jan 08 '10 19:01

Luiscencio


1 Answers

If the control supports transparent backgrounds, you can use Color.FromArgb() to set a translucent color:

button1.BackColor = Color.FromArgb(100, Color.Red);

Depending on how you want this to work, you would vary the alpha value based on mouse position (to between 0 and 255).

like image 199
Jon B Avatar answered Oct 11 '22 17:10

Jon B