超急!!!知道的就留下答案!VB基础知识

来源:百度知道 编辑:UC知道 时间:2024/06/30 06:43:00
就是3个数排序问题,排序已经OK,我作了3个TEXT一个LABEL,一个按钮,过程都在按钮里做,要求最后的排序结果要显示在LABEL里面,请问如何在LABEL里面显示text1<text2<text3?不要C++语言,要VB

label1.caption = text1.text & "<" & text2.text & "<" & text3.text

这是我以前编的,有一些修改,但本人已不用VB
了,所以你应看清楚代码,经过调试才可以,这是我的建议。
Private Sub cmdClear_Click()//"清空"按钮的代码
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
lblResult.Caption = ""
Text1.SetFocus

End Sub

Private Sub cmdCompare_Click()//"比较"按钮的代码
Dim x1 As Integer
Dim x2 As Integer

Dim x3 As Integer
Dim a As Integer
Dim b As Integer
Dim c As Integer
If Not IsNumeric(Text1.Text) Or Not IsNumeric(Text2.Text) Or Not IsNumeric(Text3.Text) Then
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text1.SetFocus
Else
x1 = Val(Text1.Text)
x2 = Val(Text2.Text)
x3 = Val(Text3.Text)
If x1 >= x2 Then
a = x1
b = x2
Else
a = x2
b = x1
End If
If x3 >= a Th