下面有两到Vb操作题,我是一名要参加今年信息技术学考的高中生,希望大家帮一下我!Thanks!
第一题:修改VB程序,使其具有下列功能:在文本框Text1中输入一个不大于10000的正整数n,单击“分解”按钮Command1,在标签Label3中显示n的质因数分解结...
第一题: 修改VB程序,使其具有下列功能:在文本框Text1中输入一个不大于10000的正整数n,单击“分解”按钮Command1,在标签Label3中显示n的质因数分解结果。 Private Sub Command1_Click()
im n As Long, m As Long 'n存放输入的数据,m存放逐次分解的因子
① = Val(Text1.Text)
Label3.Caption = ""
m = 2
Do While n > 1
If n Mod m = 0 Then
n = n \ m
If Label3.Caption = "" Then
Label3.Caption = Str(m)
Else
Label3.Caption = Label3.Caption + "×" + Str(m)
End If
Else
m = m + 1
End If
Loop
End Sub
,这里1出该怎样改
Private Sub Timer1_Timer()
Dim r As Integer, g As Integer, b As Integer
r = Int(Rnd * 256)
g = Int(Rnd * 256)
b = Int(Rnd * 256)
List1.BackColor = RGB(r, g, b) '①
End SubPrivate Sub Timer1_Timer()
End Sub 单击“暂停”按钮Command1,文本框Text1背景颜色变幻暂停,单击“继续”按钮Command2则继续变幻显示。1要怎样改 展开
im n As Long, m As Long 'n存放输入的数据,m存放逐次分解的因子
① = Val(Text1.Text)
Label3.Caption = ""
m = 2
Do While n > 1
If n Mod m = 0 Then
n = n \ m
If Label3.Caption = "" Then
Label3.Caption = Str(m)
Else
Label3.Caption = Label3.Caption + "×" + Str(m)
End If
Else
m = m + 1
End If
Loop
End Sub
,这里1出该怎样改
Private Sub Timer1_Timer()
Dim r As Integer, g As Integer, b As Integer
r = Int(Rnd * 256)
g = Int(Rnd * 256)
b = Int(Rnd * 256)
List1.BackColor = RGB(r, g, b) '①
End SubPrivate Sub Timer1_Timer()
End Sub 单击“暂停”按钮Command1,文本框Text1背景颜色变幻暂停,单击“继续”按钮Command2则继续变幻显示。1要怎样改 展开
1个回答
推荐于2016-02-06
展开全部
第一题:① n
第二题:
Private Sub Command1_Click()
Timer1.Interval = 500
Timer1.Enabled = True
End Sub
Private Sub Command2_Click()
Timer1.Enabled = False
End Sub
Private Sub Timer1_Timer()
Dim r As Integer, g As Integer, b As Integer
r = Int(Rnd * 256)
g = Int(Rnd * 256)
b = Int(Rnd * 256)
Text1.BackColor = RGB(r, g, b)
End Sub
第二题:
Private Sub Command1_Click()
Timer1.Interval = 500
Timer1.Enabled = True
End Sub
Private Sub Command2_Click()
Timer1.Enabled = False
End Sub
Private Sub Timer1_Timer()
Dim r As Integer, g As Integer, b As Integer
r = Int(Rnd * 256)
g = Int(Rnd * 256)
b = Int(Rnd * 256)
Text1.BackColor = RGB(r, g, b)
End Sub
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询