1

I have bunifutransition1 that slides my mainpanel from left to right upon clicking showbutton. (It shows the hidden mainpanel.)

What I want is, when I click closebutton, the mainpanel will slide from right to left (to hide the mainpanel again). It seems that bunifuTransition does not have an animation that reverses the animation of VertSlide or HorizSlide.

What should I do to slide my mainpanel from right to left to hide it again on my form?

Hans Passant
  • 922,412
  • 146
  • 1,693
  • 2,536

3 Answers3

0

I was having the exact same issue but upon reading your question the answer finally became prevalent in my mind. The solution here is to stop using BunifuTranisition altogether and go for the good ol' for loops and the other mods, puns intended.

int originalWidth = panel.width;
int menuClicksIndex = 0;

private void beginTransition()
{
    if (menuClickIndex % 2 == 0)
    {
        //This executes on the first click
        for(int i = originalWidth-1; i>=0; i--)
        {
           // Loops from original width to 0
            panel.Width = i;
        }
    }
    else
    {
        for (int i = 0; i <= originalWidth; i++)
        {
            panel.Width = i;
        }
    }
    menuClickIndex++;
}

This works for me but it glitches on the way back from left to right. So a mixed version with BunifuTransitions for the opener and the for loop for the closer would be the ideal solution here.

UPDATE 1: It seems as if while changing the width of the panel from 0 to say, 350, the content inside the panel doesn't render until the height is set to the max, but while decreasing the height from 350 to 0, the content is already rendered and so it seems smooth to close but cluttery to open, hence probably explaining why BunifuTransition is unable to do that as well.

TheFlyBiker 420
  • 69
  • 1
  • 13
0

Solution Here.

Just go bunifu transition properties Open or dragdown DefaultAnimation. Find this option in menu ("Side Coeff") It Show value of X and Y {X=1, Y=0} . You just change this value {X=-1, Y=0}. Then Start your project and check. Your slider sliding left to right. :)

Keep enjoy. Regards, Haris Ali

0

Use this command: bunifuTransition1.HideSync(guna2Panel1); before any code on event button click!

RusArtM
  • 1,116
  • 3
  • 15
  • 22
Bauluccy
  • 1
  • 2