opacity reduce by button click

G

Guest

Hi,

what is the code in C# for reduce the opacity every click on the button to
0.1, example:
the opacity is 1.0 for 100% i need to go down from 1.0 to 0.0(0.9,0.8,0.7
etc )?
 
C

chanmm

float fltOpa = 1;

private void button1_Click(object sender, EventArgs e)

{


this.Opacity = fltOpa;

fltOpa -= 0.1;

}

chanmm
 
B

Ben Voigt

chanmm said:
float fltOpa = 1;

private void button1_Click(object sender, EventArgs e)

{


this.Opacity = fltOpa;

fltOpa -= 0.1;

if (fltOpa < 0.0) fltOpa = 0.0;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top