前面一个elif后面没写内容
可以加上一个缩进,后面pass
这段程序的错误在于使用了中文的注释符号“#”,应该使用英文的注释符号“#”。另外,程序中缺少了打印输出结果的语句,可以使用print()函数来实现。以下是修改后的程序:
# 计算1到100的和
sum = 0
for i in range(1, 101):
sum += i
print(sum)
答案:
Private Sub HSB_Change()
Text3.Text = HSB.Value
Label4.BackColor = RGB(Val(Text1.Text), Val(Text2.Text), Val(Text3.Text))
End Sub
Private Sub HSB_Scroll()
Text3.Text = HSB.Value
Label4.BackColor = RGB(Val(Text1.Text), Val(Text2.Text), Val(Text3.Text))
End Sub
Private Sub HSG_Change()
Text2.Text = HSG.Value
Label4.BackColor = RGB(Val(Text1.Text), Val(Text2.Text), Val(Text3.Text))
End Sub
Private Sub HSG_Scroll()
Text2.Text = HSG.Value
Label4.BackColor = RGB(Val(Text1.Text), Val(Text2.Text), Val(Text3.Text))
End Sub
Private Sub HSR_Change()
Text1.Text = HSR.Value
Label4.BackColor = RGB(Val(Text1.Text), Val(Text2.Text), Val(Text3.Text))
End Sub
Private Sub HSR_Scroll()
Text1.Text = HSR.Value
Label4.BackColor = RGB(Val(Text1.Text), Val(Text2.Text), Val(Text3.Text))
End Sub