Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > .NET General

Vista - How can I get a form to gradually fade rather than just hide

Reply
 
Old 02-03-2009   #1 (permalink)
ngrTerry


 
 

How can I get a form to gradually fade rather than just hide

I have just tried to post a message, but it disappeared off the screen
so I do not know if it's previously posted. If this is duplicated then
please accept my apologies.

I have a form which shows on the screen and currently hides itself
after 15 seconds, but I would rather it faded out gradually over a
space of ten seconds.

I have played with the frm.opacity percentage, and run this in a for i
= 1000 to 0 step -1 but this does not fade the form at all. I have
also tried to put an application.doevents there too, and print the int
(i/100) value on the screen and this shows fine, but the opacity does
not fade.

Please does anyone know if I can get a form to gradually fade out.

I am using VB.NET 2005

Thank you in advance for any feedback.

Terry

My System SpecsSystem Spec
Old 02-03-2009   #2 (permalink)
Cor Ligthert[MVP]


 
 

Re: How can I get a form to gradually fade rather than just hide

Terry,

Use a Timer, 1000 to 0 step -1 is something you and y cannot see

We are human you know I thought that it was that everything that flashes
inside second/18 we don't see and this are pico's or less.

Cor

"ngrTerry" <ngr@xxxxxx> wrote in message
news:a1a3db28-16f6-40be-8b76-bd0a6eaa51be@xxxxxx
Quote:

>I have just tried to post a message, but it disappeared off the screen
> so I do not know if it's previously posted. If this is duplicated then
> please accept my apologies.
>
> I have a form which shows on the screen and currently hides itself
> after 15 seconds, but I would rather it faded out gradually over a
> space of ten seconds.
>
> I have played with the frm.opacity percentage, and run this in a for i
> = 1000 to 0 step -1 but this does not fade the form at all. I have
> also tried to put an application.doevents there too, and print the int
> (i/100) value on the screen and this shows fine, but the opacity does
> not fade.
>
> Please does anyone know if I can get a form to gradually fade out.
>
> I am using VB.NET 2005
>
> Thank you in advance for any feedback.
>
> Terry
My System SpecsSystem Spec
Old 02-04-2009   #3 (permalink)
eBob.com


 
 

Re: How can I get a form to gradually fade rather than just hide

Here's the code I use to fade-in a form. It's in a Shown event handler.

For i As Integer = 0 To 100
Me.Opacity = i / 100
Thread.Sleep(10)
Next i

Since I am fading-in and you want to fade-out you probably want to run the
loop backwards.

Good Luck, Bob


"ngrTerry" <ngr@xxxxxx> wrote in message
news:a1a3db28-16f6-40be-8b76-bd0a6eaa51be@xxxxxx
Quote:

>I have just tried to post a message, but it disappeared off the screen
> so I do not know if it's previously posted. If this is duplicated then
> please accept my apologies.
>
> I have a form which shows on the screen and currently hides itself
> after 15 seconds, but I would rather it faded out gradually over a
> space of ten seconds.
>
> I have played with the frm.opacity percentage, and run this in a for i
> = 1000 to 0 step -1 but this does not fade the form at all. I have
> also tried to put an application.doevents there too, and print the int
> (i/100) value on the screen and this shows fine, but the opacity does
> not fade.
>
> Please does anyone know if I can get a form to gradually fade out.
>
> I am using VB.NET 2005
>
> Thank you in advance for any feedback.
>
> Terry

My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Auto-Hide toolbar won't hide? Vista General
Fade in and Fade out Boxes Vista General
Windows Mail gradually getting worse Vista mail
Hide a Windows form PowerShell
Hide Vista Taskbar (without using auto-hide)? Vista General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46