public void Nav(Form form, Panel panel) { // changing view for content panel form.TopLevel = false; form.Size = panel.Size; // for responsive size panel.Controls.Clear(); panel.Controls.Add(form); form.Show(); // getting name of form that is being viewed, and assigning header title and button text from from that value nameOfFormOpen = form.Name; string currTitle = ""; string newTitle = ""; // removing value "GUI" from name to be more user friendly if (nameOfFormOpen.Contains("GUI")) { currTitle = nameOfFormOpen.Replace("GUI", ""); newTitle = InsertSpaceBeforeUpperCase(currTitle); } lblNameOfFormOpen.Text = newTitle; ChangeButtons(newTitle.ToLower()); if (nameOfFormOpen.Equals("DashboardGUI") || nameOfFormOpen.Equals("VenuesGUI")) { //if (nameOfFormOpen.Equals("DashboardGUI")) { HideButtons(); } else if (nameOfFormOpen.Equals("ReservationsGUI")) { BtnCreateNew.Hide(); BtnEdit.Hide(); BtnDelete.Show(); } else { ShowButtons(); } }
public void ShowButtons() { BtnCreateNew.Show(); BtnEdit.Show(); BtnDelete.Show(); }
public void HideButtons() { BtnCreateNew.Hide(); BtnEdit.Hide(); BtnDelete.Hide(); }