Option Explicit
Private Sub Combo1_Change()
List1.Clear
List2.Clear
Command1.SetFocus
End Sub
Private Sub Combo1_Click()
List1.Clear
List2.Clear
Command1.SetFocus
End Sub
Private Sub Combo2_Change()
List1.Clear
List2.Clear
End Sub
Private Sub Combo2_Click()
List1.Clear
List2.Clear
End Sub
Private Sub Command1_Click()
Dim a As Integer
Dim b, c, d, e, f As Variant
a = Val(Combo1.Text)
For b = 1 To 5
For c = 0 To 10
For d = 0 To 10
If (c + d) <= 10 And (c + d) > 0 Then
If (a \ b) = (c + d) Then
e = b & "×" & "(" & (c & "+" & d) & ")"
List1.AddItem e
f = a Mod b
If (a Mod b) = 0 Then
List2.AddItem ""
Else
List2.AddItem f
End If
End If
End If
Next
Next
Next
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
Dim i, x As Integer
For i = 10 To 50
Combo1.AddItem i
Next i
For x = 2 To 10
Combo2.AddItem x
Next x
End Sub
我现在想控制combo2控件,当combo2控件没有数据时,list1和list2列表框为空,并且提示"请选择系数" 当combo2控件的值为2时,list1列表框显示变量"e"的表达式,list2列表框显示变量"f"的表达式,
各位帮忙修改修改