你好。。。。我想问你个问题啊。。。就是那个VB小程序中怎么让窗体每隔1秒出现一个啊。。。

2025-01-07 22:07:22
推荐回答(2个)
回答1:

Private Sub Timer1_Timer()
Dim form3 As New Form2
form3.Show
End Sub
'添加两个窗体:form1,form2,
'在form1上添加timer控件:timer1,写入上代码即可
'timer的interval设为1000

回答2:

Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim strArray() As String = TextBox1.Text.Split( " ")
Dim intArray(100) As Int32
Dim i As Int32
For i = 0 To strArray.GetUpperBound(0)
intArray(i) = Convert.ToInt32(strArray(i))
Next
ReDim Preserve intArray(i - 1)
Array.Sort(intArray)
For i = 0 To intArray.GetUpperBound(0)
TextBox2.Text &= intArray(i).ToString & " "
Next
End Sub
End Class

1框中输入数字,点击按钮,2框中显示排序好的数字