Reputation: 11
i'm working on a project with C# and i'm occurring a problem while hiding a panel with (BunifuTransition) framework. so basically i have many buttons as(Menu Buttons) and a subpanel with buttons as (submenu) and i'm having this problem...
So in here you can see that the Show and Hide panel works fine with all the clicked buttons... Working fine in here
But when i try to close the same panel with clicking on the same button that shows it, here is what happened... The panel closes but without Bunifu Animator
Here is the codes you need to know
private void HideSubMenu() //Method to hide the subpanles (BunifuAnimator)
{
if (PanelOtherRulesSubMenu.Visible == true)
PanelSubMenuAnimation.HideSync(PanelOtherRulesSubMenu);
}
--------------
private void ShowSubMenu(Panel Submenu) //Method to show the subpanels
{
if (PanelOtherRulesSubMenu.Visible == false)
PanelSubMenuAnimation.ShowSync(PanelOtherRulesSubMenu);
if (Submenu.Visible == false)
{
HideSubMenu();
Submenu.Visible = true;
}
else
Submenu.Visible = false;
and in here you can see that all the buttons are invoked to hide the subpanel, with exception of the "Other Rules", it is invoked the show the subpanels with some coditions ...
private void btnGovermentRules_Click(object sender, EventArgs e)
{
HideSubMenu();
}
private void GangRules_Click(object sender, EventArgs e)
{
HideSubMenu();
}
private void btnBusinessRules_Click(object sender, EventArgs e)
{
HideSubMenu();
}
private void btnBuildingRules_Click(object sender, EventArgs e)
{
HideSubMenu();
}
private void btnSubMenuOR_Click(object sender, EventArgs e) //here is the button invoked to show the panel
{
ShowSubMenu(PanelOtherRulesSubMenu);
}
And now guys i need you to help make the closing animation work as well when clicking "btnSubMenuOR_Click" button to close the subpanel. Thank you,
Upvotes: 0
Views: 309
Reputation: 11
Problem solved!.I just tried to remove and replace some lines of code as showing below, from this:
private void ShowSubMenu(Panel Submenu) //Method to show the subpanels
{
if (PanelOtherRulesSubMenu.Visible == false)
PanelSubMenuAnimation.ShowSync(PanelOtherRulesSubMenu);
if (Submenu.Visible == false)
{
HideSubMenu();
Submenu.Visible = true;
}
else
Submenu.Visible = false;
to this:
private void ShowSubMenu(Panel Submenu)
{
if (PanelOtherRulesSubMenu.Visible == false)
PanelSubMenuAnimation.ShowSync(PanelOtherRulesSubMenu);
else
PanelSubMenuAnimation.HideSync(PanelOtherRulesSubMenu);
}
Upvotes: 0