public void TryCloseMenu(UIState targetState, YieldComplete onYieldComplete) { if (State == UIState.BlockInput || targetState == State) { return; } switch (State) { case UIState.SortMenu: SetState(UIState.BlockInput); _sortPanel.Hide(() => { SetState(UIState.Menu); onYieldComplete(); }); return; case UIState.SearchMenu: SetState(UIState.BlockInput); _searchPanel.Hide(() => { SetState(UIState.Menu); onYieldComplete(); }); return; } onYieldComplete(); }
private void TeamsForm_SizeChanged(object sender, EventArgs e) { if ((this.Height > 640)) // Maximized { // Panels RightBackPanel.Size = new Size(118, 0); SearchPanel.Show(); PartionPanel.Hide(); MemberGrid.Show(); if (Person == "Admin") { TeamGrid.Dock = DockStyle.Left; // Make TeamGrid Dock Left PartionPanel.Show(); UpdateIconButton.Hide(); DeleteIconButton.Location = new Point(11, 62); } else if (ButtonPressed == 0) // Show all Teams Head/Non-Head Member { RightPanel.Hide(); } else if (ButtonPressed == 1) { if (Person == "Head") // Show My Team of Head-Member { RightPanel.Show(); UpdateIconButton.Hide(); DeleteIconButton.Location = new Point(11, 62); } else // Show My Team of Non-Head-Member { RightPanel.Hide(); } } } else // Restored { // Panels RightBackPanel.Size = new Size(136, 0); PartionPanel.Hide(); SearchPanel.Hide(); MemberGrid.Hide(); TeamGrid.Dock = DockStyle.Fill; // Make TeamGrid Dock Fill so it occupy all remaining form if (Person == "Admin") // Admin Case { UpdateIconButton.Show(); DeleteIconButton.Location = new Point(11, 104); } else // All other Possible Cases { RightPanel.Hide(); } } }
private void SearchButton_Click(object sender, EventArgs e) { //Container.BringToFront(); if (Customer.Checked) { if (!string.IsNullOrWhiteSpace(SearchTextBox.Text)) { if (p1.SearchCustomer(SearchTextBox.Text)) { CustomerContainer.BringToFront(); SearchPanel.Hide(); Registration.Hide(); AmountPayment.Hide(); amountpaymentcu.Hide(); } else { MessageBox.Show("Wrong ID"); } } } else if (Dealer.Checked) { if (p1.SearchDealer(SearchTextBox.Text)) { DealerContainer.BringToFront(); SearchPanel.Hide(); Registration.Hide(); AmountPayment.Hide(); amountpaymentcu.Hide(); } else { MessageBox.Show("Wrong ID"); } } Registration.Hide(); }