Private Sub Form_Load() Me.Caption = "改變字號" HScroll1.Min = 12 HScroll1.Max = 72 Label1.Caption = "心想事成" End Sub Private Sub HScroll1_Change() Label1.FontSize = HScroll1.Value End Sub Private Sub Text1_Change() If Len(Text1.Text) > 2 Then Text1.Text = Left(Text1.Text, 2) End If If Val(Text1) >= 12 And Val(Text1) <= 72 Then Label1.FontSize = Val(Text1.Text) End If End Sub
Private Sub Form_Load() Me.Caption = "改變字號" HScroll1.Min = 12 HScroll1.Max = 72 Label1.Caption = "心想事成" End Sub Private Sub HScroll1_Change() Label1.FontSize = HScroll1.Value End Sub Private Sub Text1_Change() If Len(Text1.Text) > 2 Then Text1.Text = Left(Text1.Text, 2) End If If Val(Text1) >= 12 And Val(Text1) <= 72 Then Label1.FontSize = Val(Text1.Text) End If End Sub