用VB.NET 2010 (看清程序)编写两个程序

2025-04-25 10:19:28
推荐回答(2个)
回答1:

3分钟给你把第二题写好了,拖一个Timer1和Label控件,把Label1的AutoSize设为False,文字清空,然后拖成一个方块形状。

Public Class Form1
    Dim T As Integer
    Dim D As Integer
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Timer1.Enabled = True
        Timer1.Interval = 100
        Label1.BackColor = Color.Red
        D = 1
    End Sub
    Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
        T += 1
        If T >= 300 And D = 1 Then T = 0 : D = 2 : Label1.BackColor = Color.Green
        If T >= 300 And D = 2 Then T = 0 : D = 3 : Label1.BackColor = Color.Yellow
        If T >= 30 And D = 3 Then T = 0 : D = 1 : Label1.BackColor = Color.Red
    End Sub
End Class

回答2:

是什么时候要呢?