Form opacity and timer.
Example1
In this first form wil be transparent and at the end of timer. Form look wil be changed.
Public Class Form2 Dim i As Integer Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load i = 5 End Sub Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick If i > 255 Then i = 0 Else Me.BackColor = Color.FromArgb(i, i, i) i = i + 10 End If If i = 255 Then Me.Opacity = 100% Me.BackColor = Color.FromArgb(i, i, i) Timer1.Enabled = False End If End Sub End Class
Example2
Timer and processing bar.
Public Class Form3 Dim i As Integer Private Sub Form3_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load PB1.Maximum = 100 PB1.Minimum = 0 'PB1.Step = 10 'PB1.Increment(10) i = 0 End Sub Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick PB1.Value = i If i = 10 Then Label1.Text = "Wait" & i & "%" ElseIf i = 30 Then Label1.Text = "Checking for the connection" & i & "%" ElseIf i = 50 Then Label1.Text = "Connecting with the database" & i & "%" Else Label1.Text = "Going to complete" & i & "%" End If i = i + 10 If i = 100 Then PB1.Value = 100 Timer1.Enabled = False Label1.Text = "Completed Processing continue ur work" Dim F As New Timerex2 Me.Visible = False F.Show() End If End Sub
Private Sub PB1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PB1.Click
End Sub
Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click
End Sub End Class
regards Neetu
|
No responses found. Be the first to respond and make money from revenue sharing program.
|