Skin Form -slide (push / pull) eq / playlist panel.

Jan Dvorak 1 Reputation point
2021-08-31T01:54:47.63+00:00

Hi,
sorry i don't understand english well.
Everything is written with the help of google translator. I'm a hobbyist. I will try to create a player with a slide (push / pull) eq / playlist panel.
This effect is present, for example, in windows media player or aimp player. Nowhere can I find an example of how to achieve this effect.
I want to ask how to create it in c # / vb.net.
I hope you understand the question. thank you for answer.
Sincerely Jan

Windows Forms
Windows Forms
A set of .NET Framework managed libraries for developing graphical user interfaces.
1,906 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Jack J Jun 24,606 Reputation points Microsoft Vendor
    2021-09-02T02:11:54.343+00:00

    @Jan Dvorak , you can try to use three panels two buttons and two timers to make a expandable.

    Here is a code example you could refer to.(The right panel)

    public partial class Form1 : Form  
        {  
            public Form1()  
            {  
                InitializeComponent();  
                centerpanel.Parent = this;  
                leftpanel.Parent = this;  
                rightpanel.Parent = this;  
                this.StartPosition = FormStartPosition.Manual;  
                this.Location = new Point(700, 400);  
            }  
      
            bool isRight = false;  
            bool isLeft = false;  
      
            private System.Timers.Timer myTimer;  
      
      
            private void button1_Click(object sender, EventArgs e)  
            {  
                isRight = !isRight;  
                rightpanel.Visible = true;  
                centerpanel.BringToFront();  
                this.myTimer = new System.Timers.Timer(10);  
                this.myTimer.Elapsed += new System.Timers.ElapsedEventHandler(right_Elapsed);  
                this.myTimer.AutoReset = true;  
                this.myTimer.Enabled = true;  
                this.myTimer.Start();  
            }  
      
            private void right_Elapsed(object sender, ElapsedEventArgs e)  
            {  
                if (isRight)  
                {  
                    if (this.Width + 15 > rightpanel.Width * 2)  
                    {  
                        this.myTimer.Enabled = false;  
                        this.myTimer.Stop();  
                    }  
      
                    if (this.InvokeRequired)  
                    {  
                        this.Invoke(new MethodInvoker(delegate { Width += 10; }));  
                        rightpanel.Invoke(new MethodInvoker(delegate { rightpanel.Left += 10; }));  
                    }  
                }  
                else  
                {  
                    if (this.Width - 10 < rightpanel.Width)  
                    {  
                        this.myTimer.Enabled = false;  
                        this.myTimer.Stop();  
                        rightpanel.Invoke(new MethodInvoker(delegate { rightpanel.Visible = false; }));  
                    }  
      
                    if (this.InvokeRequired)  
                    {  
                        this.Invoke(new MethodInvoker(delegate { Width -= 10; }));  
                        rightpanel.Invoke(new MethodInvoker(delegate { rightpanel.Left -= 10; }));  
                    }  
                }  
            }  
            
            private void Form1_Load(object sender, EventArgs e)  
            {  
                rightpanel.Visible = false;  
                leftpanel.Visible = false;  
                button1.Parent = centerpanel;  
                button1.Location = new Point(257, 0);  
      
                button2.Parent = centerpanel;  
                button2.Location = new Point(0, 0);  
                
                this.FormBorderStyle = FormBorderStyle.None;  
            }  
      
            
        }  
    

    Result:
    128396-555.gif


    If the response is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.