请问VB当中当list1里的数字到list2中后按大小排列的代码该怎么写?如图所示,list1中的数字到list2中后按从小到大排列,然后在list1中加入新数字,左右互换后,两边的数字依然按从小到大排列.Private

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/24 08:44:10

请问VB当中当list1里的数字到list2中后按大小排列的代码该怎么写?如图所示,list1中的数字到list2中后按从小到大排列,然后在list1中加入新数字,左右互换后,两边的数字依然按从小到大排列.Private
请问VB当中当list1里的数字到list2中后按大小排列的代码该怎么写?



如图所示,list1中的数字到list2中后按从小到大排列,然后在list1中加入新数字,左右互换后,两边的数字依然按从小到大排列.


Private Sub command1_click()
Dim a As Integer
a = 0
Do While a < List1.ListCount
If List1.Selected(a) = True Then List2.AddItem List1.List(a):List1.RemoveItem a Else a = a + 1
Loop
End Sub
Private Sub command2_click()
Dim a As Integer
a = List1.ListCount - 1
For i = 0 To a
List2.AddItem List1.List1(i)
Next i
List1.Clear
End Sub
Private Sub command3_click()
Dim a As Integer
a = 0
Do While a < List2.ListCount
If List2.Selected(a) = True Then List1.AddItem List2.List(a):List2.RemoveItem a Else a = a + 1
Loop
End Sub
Private Sub Command4_Click()
Dim a As Integer
a = List2.ListCount - 1
For i = 0 To a
List1.AddItem List2.List(i)
Next i
List2.Clear
End Sub
Private Sub form_load()
List1.Clear
List2.Clear
List1.AddItem "7"
List1.AddItem "18"
List1.AddItem "25"
List1.AddItem "13000"
List1.AddItem "2000"
List1.AddItem "50000"
List1.AddItem "299"
Command1.Caption = ">"
Command2.Caption = ">>"
Command3.Caption = "<"
Command4.Caption = "<<"
Command5.Caption = "从小到大排序"
Command6.Caption = "左右互换"
Label2.Caption = "数字一"
Label3.Caption = "数字二"
Label1.Caption = "按Shift或Ctrl键可以多选"
End Sub


这是我前面已经写好的代码,就是比大小的代码如何写不知道,

请问VB当中当list1里的数字到list2中后按大小排列的代码该怎么写?如图所示,list1中的数字到list2中后按从小到大排列,然后在list1中加入新数字,左右互换后,两边的数字依然按从小到大排列.Private
在List2的属性中设置 Sorted 属性为 True 即可,这个属性是设置是否自动按字母顺序排列的属性.

请问VB当中当list1里的数字到list2中后按大小排列的代码该怎么写?如图所示,list1中的数字到list2中后按从小到大排列,然后在list1中加入新数字,左右互换后,两边的数字依然按从小到大排列.Private VB中list的问题?Private Sub Form_Load()List1.AddItem GermanyList1.AddItem IndiaList1.AddItem FranceList1.AddItem CanadaList1.AddItem USAList1.AddItem JapanList1.AddItem ChinaEnd Sub不用鼠标点中列表,怎么判断list中是不 VB:For i = 0 To List1.ListCount - 1,后面的List1.ListCount - VB代码意思List1.RemoveItem List1.ListIndex VB将一组数随机排列到list1,比如1到100 vb产生20个随机数放入list1再将其中不同的数放在list2 List1.AddItem List1.Text List1.RemoveItem List1.ListIndex 这两句话的详细意思? 磷酸的化学性质lis VB单击命令按钮,则文本框(text1)的英文句子按单词分解到列表框(list1),帮帮忙把代码补全(问号处)Private Sub Command1_Click() Dim S1 As String, S2 As String Dim I1 As Integer' S1 = ? I1 = 1 Do' Il y a 10 ans,je ai lu beaucoup,maintenant je lis de moins en moins.Il y a 10 ans,je (ai lu) beaucoup,maintenant je lis de moins en moins.请问括号里(ai lu)为什么不用lirais呢?我十年前爱看书,是以前的常态呀,为什么用复合过 1到100数字当中个位和十位相差3的数是多少 VB 从1到500所有自然数中不含数字4的自然数共有多少个 VB提取 数字 各位数的数字最简单的方法?而且还要在把各个位的数字按顺序放入各变量当中!似乎是用循环结构吧! List1.RemoveItem List1.ListIndex VB里的Cstr是什么意思? VB里的步长是什么意思 当一个人进入一个新的环境时,如何才能尽快地融入到新环境当中? 在线等!VB随机给数!VB生成三个不相同的0到9随机数!然后保存在一个数组中!三个数字要不相同