Public Class Form1
Private Sub HScrollBar1_Scroll(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ScrollEventArgs) Handles HScrollBar1.Scroll
'okay me.opacity actually mean, the parent form or the main form or the active form, the rest you can figure it out yourself, the opacity of the form depends on the value the scrollbar is at currently'
Me.Opacity = 0.1 + HScrollBar1.Value / 100
'this code is just extra just to show you the opacity value currently on the title bar of the form'
Me.Text = Me.Opacity.ToString
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'this one is to make the scrollbar start at 100 when the program load so u can actually see the program on initial startup lol (p/s : try and remove this line and see what happen, dont worry it wont harm your computer) p/s again : this colour reminds me of someone's tamagotchi lol'
HScrollBar1.Value = 100
End Sub
End Class
Labels: vb.net