Hi David,
Here's a code sample that shows how to fade in/out a form. Just drop a
button onto the form and write the following click event handler:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim i As Double
Me.Button1.Enabled = False
For i = 1 To 0 Step -0.01
System.Windows.Forms.Application.DoEvents()
System.Threading.Thread.Sleep(10)
Me.Opacity = i
Next
For i = 0 To 1 Step 0.01
System.Windows.Forms.Application.DoEvents()
System.Threading.Thread.Sleep(10)
Me.Opacity = i
Next
Me.Button1.Enabled = True
End Sub
Cheers,
Sean Draine
Visual Basic.NEt Team
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Quote:
> Hi
> Can anyone give me some code for a fade out effect using a form Opacity
> property? I can't seem to get it working properly.....
> thanks,
> - David Angelovich