|
-
Jan 11th, 2005, 02:00 PM
#1
Thread Starter
<?="Moderator"?>
Fade a Panel [RESOLVED]
Is it possible to change the opacity on a Panel control. I have search but all i could find was about window forms.
Thanks
Last edited by john tindell; Jan 28th, 2005 at 10:31 AM.
-
Jan 23rd, 2005, 05:27 AM
#2
Re: Fade a Panel
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
Last edited by wossname; Jan 23rd, 2005 at 05:38 AM.
I don't live here any more.
-
Sep 25th, 2012, 02:21 PM
#3
Addicted Member
Re: Fade a Panel
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
-
Sep 25th, 2012, 08:50 PM
#4
Re: Fade a Panel
 Originally Posted by vasil7112
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 
Put a panel inside the panel would probably be the easiest way to do that.
-
Sep 25th, 2012, 11:20 PM
#5
Addicted Member
Re: Fade a Panel
 Originally Posted by JuggaloBrotha
Put a panel inside the panel would probably be the easiest way to do that.
Well here is my stracture
A panel with transparent BG that shows the BG of the template
Some buttons in the panel
And what i want now, is a code the will make all the buttons fade away, but only by typing a small code like fade a panel
-
Sep 26th, 2012, 11:27 AM
#6
Re: Fade a Panel [RESOLVED]
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|