Create a setting called 'opac'
(Double click on the solution explorer window, 'My project')
Find the 'settings' tab.
Name = opac, Type = double, Scope = user, Value = 1
On a form with 2 buttons:
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
' More transparent
Me.Opacity -= 0.01
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
' Less transparent
Me.Opacity += 0.01
End Sub
Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
My.Settings.opac = Me.Opacity
End Sub
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Me.Opacity = My.Settings.opac
End Sub
End Class
|