Form Opacity Property

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi All,
When the user closes my app I would like the form to disapear slowly, I have
tried using the form opacity property in a loop driven by a timer. The form
disapears but the app does not end (I have to right click the icon in the
task bar and close it). Any idea why?

I have this code in the timer event:
formdim = formdim - 0.01
Me.Opacity = formdim
If formdim = 0.01 Then Timer1.Enabled = False : End


Thanks in advance,
Roger.
 
I have just tried Close( ) but that behaves the same way - any other idea's??

Roger.

Miha Markic said:
Hi Roger,

Did you try calling Close() at the end?

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com

Roger said:
Hi All,
When the user closes my app I would like the form to disapear slowly, I
have
tried using the form opacity property in a loop driven by a timer. The
form
disapears but the app does not end (I have to right click the icon in the
task bar and close it). Any idea why?

I have this code in the timer event:
formdim = formdim - 0.01
Me.Opacity = formdim
If formdim = 0.01 Then Timer1.Enabled = False : End


Thanks in advance,
Roger.
 
I don't know why but:

If formdim < 0.01 Then Timer1.Enabled = False : End
(I was using: If formdim = 0.01 Then Timer1.Enabled = False : End)
works fine?!?!?

Thanks anyways, Roger.



Roger said:
I have just tried Close( ) but that behaves the same way - any other idea's??

Roger.

Miha Markic said:
Hi Roger,

Did you try calling Close() at the end?

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com

Roger said:
Hi All,
When the user closes my app I would like the form to disapear slowly, I
have
tried using the form opacity property in a loop driven by a timer. The
form
disapears but the app does not end (I have to right click the icon in the
task bar and close it). Any idea why?

I have this code in the timer event:
formdim = formdim - 0.01
Me.Opacity = formdim
If formdim = 0.01 Then Timer1.Enabled = False : End


Thanks in advance,
Roger.
 
Roger,

You should avoid using "End", it is worser than that you tell the user to
click cntrl alt del.

"End" stops all activities including the cleaning up of your memory.

Use me.close instead as Miha sugested.

I hope this helps?

Cor
 
Back
Top