vb怎么用鼠标改变字的大小??

来源:百度知道 编辑:UC知道 时间:2024/06/07 18:37:09
在label中输入“程序”,大小30号,运行后单击鼠标左键,字体放大10号,加到100后不再增加;右击后缩小10号,小到10后不再缩小,请问怎么做???

Option Explicit
Dim FntSize%

Private Sub Form_Load()
FntSize = 30
Label1.Caption="程序"
Label1.FontSize = FntSize
End Sub

Private Sub Label1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 And FntSize < 100 Then FntSize = FntSize + 10
If Button = 2 And FntSize > 30 Then FntSize = FntSize - 10
Label1.FontSize = FntSize
End Sub