16,717
社区成员
发帖
与我相关
我的任务
分享
Public Class Form1
Dim time As Integer = 100
Dim frm2 As Form
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Timer1.Start()
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
time = time - 1
If time = 60 Then
frm2 = New Form2
frm2.Show()
Timer1.Stop()
End If
TextBox1.Text = time
End Sub
End Class
Public Class Form2
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Form1.Timer1.Start()
Me.Hide()
End Sub
End Class
Public Class Form1
Dim time As Integer = 100
Dim frm2 As Form
Dim buton As Button = New Button
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Timer1.Start()
AddHandler buton.Click, AddressOf buton_Click
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
time = time - 1
If time = 60 Then
buton.Text = "button"
frm2 = New Form
frm2.Show()
frm2.Controls.Add(buton)
frm2.Controls(0).Top = 50
frm2.Controls(0).Left = 50
Timer1.Stop()
End If
TextBox1.Text = time
End Sub
Private Sub buton_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Timer1.Start()
frm2.Hide()
End Sub
End Class
Public Class Form1
Dim time As Integer = 100
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
time = time - 1
If time = 60 Then
Form2.Show()
Timer1.Stop()
End If
TextBox1.Text = time
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Timer1.Start()
End Sub
End Class
Public Class Form2
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Form1.Timer1.Start()
Me.Hide()
End Sub
End Class