private void btnSidePanel_Click(object sender, EventArgs e) { if (!menuExpanded) { menuExpanded = true; pnlUserMenu.Visible = false; pnlUserMenu.Width = 275; AnimatedSideOn.ShowSync(pnlUserMenu); //animate content 1 castelMIMIContent1.Visible = false; castelMIMIContent1.Left += 221; castelMIMIContent1.Width -= 221; AnimatedContentOnOffSide.ShowSync(castelMIMIContent1); } else { menuExpanded = false; pnlUserMenu.Visible = false; pnlUserMenu.Width = 50; AnimatedSideOff.ShowSync(pnlUserMenu); //animate content 1 castelMIMIContent1.Visible = false; castelMIMIContent1.Left -= 221; castelMIMIContent1.Width += 221; AnimatedContentOnOffSide.ShowSync(castelMIMIContent1); } }
private void btnSidePanel_Click(object sender, EventArgs e) { if (!menuExpanded) { menuExpanded = true; pnlUserMenu.Visible = false; userTitle.Visible = true; pnlUserMenu.Width = 215; AnimatedSideOn.Show(pnlUserMenu); } else { menuExpanded = false; while (pnlUserMenu.Width > 0) { pnlUserMenu.Width -= 8; } pnlUserMenu.Visible = false; userTitle.Visible = false; pnlUserMenu.Width = 50; AnimatedSideOff.Show(pnlUserMenu); } }