You are on page 1of 1

Cerrar con opacydad

Public Class Form1 Public c As Integer, opacidad As Double Public flag As Integer = 0 Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick opacidad = Me.Opacity - 0.01 Me.Opacity = opacidad If Me.Opacity = 0.0 Then Me.Close() End If End Sub Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing If flag = 0 Then e.Cancel = True flag = 1 Timer1.Enabled = True Else e.Cancel = False End If End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Close() End Sub End Class

You might also like