VB编程题,求全部代码
求大神。 展开
Private Sub Clear_Click()
Text1.Text = ""
Text2.Text = ""
List1.Clear
Text1.SetFocus
End Sub
Private Sub Lookup_Click()
Dim i As Integer, j As Integer, c As String, b(50) As String, k As Integer, t As String
c = Me.Text1.Text
For i = 1 To Len(c)
Select Case Asc(Mid(c, i, 1))
Case 65 To 90, 97 To 122
b(k) = b(k) + Mid(c, i, 1)
Case Else
k = k + 1
List1.AddItem b(k - 1)
End Select
Next i
For i = 0 To k - 2
For j = i + 1 To k - 1
If Len(b(i)) < Len(b(j)) Then
t = b(i)
b(i) = b(j)
b(j) = t
End If
Next j
Next i
Text2.Text = Text2.Text + b(0) + vbCrLf
For i = 1 To k - 1
If Len(b(i)) = Len(b(i - 1)) Then
Text2.Text = Text2.Text + b(i) + vbCrLf
Else
Exit For
End If
Next i
End Sub
2023-06-12 广告