主题:vb 请老师帮忙看看
请老师帮忙看看
这是Form2窗口语句
Private Sub Command1_Click()
Dim i&, j&, m&, ts$(2), n() As Byte
Dim tn(2) As String
ts(0) = "01234"
ts(1) = "56789"
ts(2) = ""
For i = Form1.List1.ListCount - 1 To 0 Step -1
If Check1.Value = 1 Then
tn(0) = 3
tn(1) = 0
tn(2) = 0
End If
If Check2.Value = 1 Then
tn(0) = 2
tn(1) = 1
tn(2) = 0
End If
If Check3.Value = 1 Then
tn(0) = 0
tn(1) = 3
tn(2) = 0
End If
If Check4.Value = 1 Then
tn(0) = 1
tn(1) = 2
tn(2) = 0
End If
n = StrConv(Form1.List1.List(i), 128)
For j = 0 To 2
For m = 0 To 2
If InStr(ts(m), Chr(n(j))) > 0 Then tn(m) = tn(m) - 1
Next
Next
If tn(0) = 0 And tn(1) = 0 And tn(2) = 0 Then Else Form1.List1.RemoveItem i
Next
Me.Hide
Form1.Show
End Sub
这个代码单独选一个复选好使,选择两个或多个就会只显示最后一个呢,Check2(当Check1画勾时,出一组数据(上面的代码可以),Check2画勾时出一组数据(上面的也可以)但当Check2和Check1,同时画勾时,就完了只出Check2的数据了,)怎么改能变成当Check1和Check2或其他选择的同时画勾,即输出Check1的也输出Check2或其他已经选择的的并在list显示,而且,单选也好使呢
而且,我还想改一下数据输出,就是当点击Command1后并不直接在Form1.List1输出数据了,而是只保存数据并退出,然后点击Form1的Command2时才在Form1.List1输出数据(If tn(0) = 0 And tn(1) = 0 And tn(2) = 0 Then Else Form1.List1.RemoveItem i)是要改这段代码吧,请问如何改,相应的Form1的Command2下的语句又该如何写呢
这是Form2窗口语句
Private Sub Command1_Click()
Dim i&, j&, m&, ts$(2), n() As Byte
Dim tn(2) As String
ts(0) = "01234"
ts(1) = "56789"
ts(2) = ""
For i = Form1.List1.ListCount - 1 To 0 Step -1
If Check1.Value = 1 Then
tn(0) = 3
tn(1) = 0
tn(2) = 0
End If
If Check2.Value = 1 Then
tn(0) = 2
tn(1) = 1
tn(2) = 0
End If
If Check3.Value = 1 Then
tn(0) = 0
tn(1) = 3
tn(2) = 0
End If
If Check4.Value = 1 Then
tn(0) = 1
tn(1) = 2
tn(2) = 0
End If
n = StrConv(Form1.List1.List(i), 128)
For j = 0 To 2
For m = 0 To 2
If InStr(ts(m), Chr(n(j))) > 0 Then tn(m) = tn(m) - 1
Next
Next
If tn(0) = 0 And tn(1) = 0 And tn(2) = 0 Then Else Form1.List1.RemoveItem i
Next
Me.Hide
Form1.Show
End Sub
这个代码单独选一个复选好使,选择两个或多个就会只显示最后一个呢,Check2(当Check1画勾时,出一组数据(上面的代码可以),Check2画勾时出一组数据(上面的也可以)但当Check2和Check1,同时画勾时,就完了只出Check2的数据了,)怎么改能变成当Check1和Check2或其他选择的同时画勾,即输出Check1的也输出Check2或其他已经选择的的并在list显示,而且,单选也好使呢
而且,我还想改一下数据输出,就是当点击Command1后并不直接在Form1.List1输出数据了,而是只保存数据并退出,然后点击Form1的Command2时才在Form1.List1输出数据(If tn(0) = 0 And tn(1) = 0 And tn(2) = 0 Then Else Form1.List1.RemoveItem i)是要改这段代码吧,请问如何改,相应的Form1的Command2下的语句又该如何写呢