xuying-damo
基础培训
 
类相当于一个虚拟事物
需要定义其内容,定义完成可直接调用 共享不用实体化
 
 
Public Class Form1
    Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
        Dim tR As Random = New Random
        Dim k As Integer = tR.Next(0, 100)
        Dim tD As Double = tR.NextDouble()
        Dim i As Integer = 0
        For i = 1 To 100
            k = tR.Next(0, 100)
            tD = tR.NextDouble()
            ListBox1.Items.Add("整数:" & k.ToString & "    .小敏" & tD.ToString)
            ListBox1.SelectedIndex = ListBox1.Items.Count - 1
            My.Application.DoEvents()
        Next
    End Sub
    Private Sub ListBox1_DobulicClick(sender As Object, e As EventArgs) Handles ListBox1.DoubleClick
        Dim tResult As Integer = -1
        tResult = MsgBox("确定要清空列表吗?", vbAbort)
        If tResult = MsgBoxResult.Yes Then
            ListBox1.Items.Clear()
        End If
    End Sub
    Private Sub ListBox1_SelectedIndexChanged_1(sender As Object, e As EventArgs) Handles ListBox1.SelectedIndexChanged
    End Sub
End Class
 

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2021-06-14
  • 2022-03-15
  • 2022-01-20
  • 2021-06-27
  • 2021-10-18
  • 2021-05-15
  • 2021-06-09
猜你喜欢
  • 2021-11-01
  • 2021-11-21
  • 2021-11-17
  • 2022-01-15
  • 2021-10-19
  • 2022-02-24
  • 2022-12-23
相关资源
相似解决方案