I'm confused as to how I can accomplish this. I want to press the buttons and then the bottom panels go to the top and then open, if that makes sense.

This is essentially what I have http://i.imgur.com/BzAeugE.png

And I only have the basic code for button clicks

private void CP_OneFbutton_Click(object sender, EventArgs e)
        {

        }

Any ideas guys?

有帮助吗?

解决方案

To do this you need to change Panel's Location property like this:

panel1.Location = new Point(X,Y);

If you don't know exact coordinates,then you can handle Form MouseMove event (temporarily)

 private void Form1_MouseMove(object sender, MouseEventArgs e)
    {
        label1.Text = e.X + "," + e.Y;
    }

Move mouse to the location where you want to panel move and note coordinates, then handle button click event and change panel's location

private void CP_OneFbutton_Click(object sender, EventArgs e)
    {
       panel1.Location = new Point(X,Y); // type your X and Y coordinates here
       panel1.Visible = true; // Display the panel
    }
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top