vb编程题,求大神解答! 如图 2题和4题
1个回答
展开全部
第2题
Dim Velocity As Integer
Private Sub Form_Load()
HScroll1.Min = -100
HScroll1.Max = 100
HScroll1.Value = 50
Timer1.Interval = 1
Label1.Caption = "Velocity = " & Velocity
End Sub
Private Sub HScroll1_Change()
Velocity = HScroll1.Value
Label1.Caption = "Velocity = " & Velocity
End Sub
Private Sub HScroll1_Scroll()
Velocity = HScroll1.Value
Label1.Caption = "Velocity = " & Velocity
End Sub
Private Sub Timer1_Timer()
Picture1.Left = Picture1.Left + Velocity
If Picture1.Left >= Me.Width Then Picture1.Left = -Picture1.Width
If Picture1.Left < -Picture1.Width Then Picture1.Left = Me.Width
End Sub
第4题
Private Sub Check1_Click()
If Check1.Value = 1 Then
Combo1.Visible = True
Option1.Visible = True
Option2.Visible = True
Option3.Visible = True
Else
Combo1.Visible = False
Option1.Visible = False
Option2.Visible = False
Option3.Visible = False
End If
End Sub
Private Sub Check2_Click()
If Check2.Value = 1 Then
Text1.Visible = True
List1.Visible = True
Else
Text1.Visible = False
List1.Visible = False
End If
End Sub
Private Sub Check3_Click()
If Check3.Value = 1 Then
Text2.Visible = True
List2.Visible = True
Else
Text2.Visible = False
List2.Visible = False
End If
End Sub
Private Sub Combo1_Click()
Label2.Font = Combo1.Text
End Sub
Private Sub Form_Load()
Label1.Left = (Me.ScaleWidth - Label1.Width) / 2
Label2.Left = (Me.ScaleWidth - Label2.Width) / 2
Frame1.Left = (Me.ScaleWidth - Frame1.Width) / 2
For i = 0 To Screen.FontCount - 1
Combo1.AddItem Screen.Fonts(i)
Next i
Combo1.Text = "请选择字体"
List1.AddItem "常规"
List1.AddItem "粗体"
List1.AddItem "斜体"
List1.AddItem "粗斜体"
Text1.Text = "常规"
For i = 8 To 50
List2.AddItem i
Next i
Text2.Text = 10
Combo1.Visible = False
Text1.Visible = False
Text2.Visible = False
List1.Visible = False
List2.Visible = False
Option1.Visible = False
Option2.Visible = False
Option3.Visible = False
Option1.Value = False
Option2.Value = False
Option3.Value = False
Label2.Caption = "字体演示"
End Sub
Private Sub List1_Click()
Text1.Text = List1.Text
End Sub
Private Sub List2_Click()
Text2.Text = List2.Text
End Sub
Private Sub Option1_Click()
Label2.Alignment = 0
End Sub
Private Sub Option2_Click()
Label2.Alignment = 1
End Sub
Private Sub Option3_Click()
Label2.Alignment = 2
End Sub
Private Sub Text1_Change()
If Text1.Text = "常规" Then Label2.FontBold = False: Label2.FontItalic = False
If Text1.Text = "粗体" Then Label2.FontBold = True
If Text1.Text = "斜体" Then Label2.FontItalic = True
If Text1.Text = "粗斜体" Then Label2.FontBold = True: Label2.FontItalic = True
End Sub
Private Sub Text2_Change()
Label2.FontSize = Val(Text2.Text)
End Sub
界面设计:
运行界面:
--
2022-12-05 广告
2022-12-05 广告
图形化编程简单理解为用积木块形式编程,scratch和python也是其中的一种,属于入门级编程,以其简单生动的画面获得无数学生的喜爱,深圳市创客火科技有限公司是一家做教育无人机的公司,旗下有编程无人机,积木无人机及室内外编队,每款飞机含有...
点击进入详情页
本回答由--提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询