Salve a tutti
Avrei un urgente bisogno di aiuto
Dovrei far si che, avendo la funzione Mouse_enter, il bottone appena entra il mouse cambi colore e dopo un secondo lo cambi ancora, infine dopo 2 secondi totali mi si apra un altro form, tutto cio senza fare uscire il mouse da bottone.
Il codice fin qui fatto è questo:
codice:
Public Class Form1
Private formToShow As Form
Dim value As String
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Timer1.Interval = 30
Timer1.Enabled = False
ProgressBar1.Minimum = 0
ProgressBar1.Maximum = 50
ProgressBar1.Value = 0
Button1.Tag = Form2
Button2.Tag = Form3
Button3.Tag = Form4
Button4.Tag = Form5
Button5.Tag = Form6
Button6.Tag = Form33
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
ProgressBar1.Value += 1
If ProgressBar1.Value = ProgressBar1.Maximum Then
ProgressBar1.Value = 0
Timer1.Enabled = False
Form2.Hide()
Form3.Hide()
Form4.Hide()
Form5.Hide()
Form6.Hide()
Form33.Hide()
formToShow.Show()
End If
End Sub
Private Sub Button1_MouseEnter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.MouseEnter
Timer1.Enabled = True
ProgressBar1.Value = 0
formToShow = DirectCast(sender, Control).Tag
End Sub
Private Sub Button1_MouseLeave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.MouseLeave
Timer1.Enabled = False
End Sub
Metto solo il 1o bottone perchè tanto la cosa è ripetitiva.
Vi prego aiutatemi
Grazie