Is it possible to change the opacity on a Panel control. I have search but all i could find was about window forms.
Thanks
Printable View
Is it possible to change the opacity on a Panel control. I have search but all i could find was about window forms.
Thanks
I have a quivk VB sample here... Havent got C# at home :) Shouldn't be hard to translate.
VB Code:
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick 'timer event handler Static aa As Integer Panel1.BackColor = Color.FromArgb(aa, 255, 0, 0) aa += 10 'amount of opacity change for each timer tick If aa > 255 Then Timer1.Enabled = False 'finished fade-in End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Timer1.Interval = 100 '10 times a second Timer1.Enabled = True 'go! End Sub
That should get you started. It simply uses a timer to increase the Alpha component of the panel's backcolor. Its a bit flickery but you could always use a backbuffer to solve that problem, if you can be bothered :D
Is it possible to do it somehow to work on a Transparent Panel? I want all the contents of the panel to fade away, not the panel itself;)
So put those buttons on a panel that's on the other panel, that way you can fade the buttons only panel like you want.