Form Opacity Property

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.
 
G

Guest

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.
 
G

Guest

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.
 
C

Cor Ligthert

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
 

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

Top