VB编程:编写程序,在文本框(Text1)中输入一个整数,点击图片框,找出该数的所有因子并显示在该

VB编程:编写程序,在文本框(Text1)中输入一个整数,点击图片框,找出该数的所有因子并显示在该图片框中

'给个参考程序。朋友。
Private Sub Picture1_Click()
Dim n As Integer, i As Integer
n = Val(Text1.Text)
For i = 1 To n
If n Mod i = 0 Then Picture1.Print i
Next i
End Sub
温馨提示:答案为网友推荐,仅供参考
第1个回答  2016-05-24
Private Sub Command1_Click()
Dim i As Integer
For i = 1 To Val(Text1)
If Val(Text1) Mod i = 0 Then Picture1.Print i
Next

End Sub
相似回答