Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim i As Single
i = Val(Me.Opacity)
If i < 1 Then
Me.Opacity = Me.Opacity + 0.1
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim i As Single
i = Val(Me.Opacity)
If i > 0.1 Then
Me.Opacity = Me.Opacity - 0.05
End If
End Sub
End Class首先明确透明度的区间是[0,1]
用if来判断要控制的图片的透明度
新手意见,请高手指正