期末VB机试题5,在线等!
来源:百度知道 编辑:UC知道 时间:2024/09/12 22:33:51
功能是设置文字"欢迎使用VISUAL BASIC6.0"字体大小和字体颜色,字体大小由水平滚动条来确定(最大为20,最小为10),字体颜色由三个文本框输入,采用RGB格式。要求:
(1)设置Hscroll1的属性。
(2)在过程Command1_Click()和HScroll1_Change()代码中各有一处错误,请调试更正,不得增删语句。
Private Sub Command1_Click()
Label1.ForeColor = RGB(Text1.Text, Text2.Text, Text3.Text)
End Sub
Private Sub Form_Load()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Label1.FontSize = 10
End Sub
Private Sub Frame1_DragDrop(Source As Control, X As Single, Y As Single)
End Sub
Private Sub HScroll1_Change()
Label1.FontSize = HScroll1
End Sub
(1)设置Hscroll1的属性。
(2)在过程Command1_Click()和HScroll1_Change()代码中各有一处错误,请调试更正,不得增删语句。
Private Sub Command1_Click()
Label1.ForeColor = RGB(Text1.Text, Text2.Text, Text3.Text)
End Sub
Private Sub Form_Load()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Label1.FontSize = 10
End Sub
Private Sub Frame1_DragDrop(Source As Control, X As Single, Y As Single)
End Sub
Private Sub HScroll1_Change()
Label1.FontSize = HScroll1
End Sub
Private Sub Command1_Click()
Label1.ForeColor = RGB(Val(Text1.Text), Val(Text2.Text), Val(Text3.Text)) '这里
End Sub
Private Sub Form_Load()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Label1.FontSize = 10
HScroll1.Max = 40
HScroll1.Min = 1
End Sub
Private Sub Frame1_DragDrop(Source As Control, X As Single, Y As Single)
End Sub
Private Sub HScroll1_Change()
Label1.FontSize = HScroll1.Value '这里()
End Sub