/// <summary> /// todoComment /// </summary> /// <param name="ACriteriaName"></param> /// <returns></returns> public Boolean UnSelectCriteriaPanel(String ACriteriaName) { System.Windows.Forms.Panel SearchedPanel; TPartnerFindCriteriaSelectionChangedEventArgs FindCriteriaSelectionChangedArgs; Int32 Counter1; Int32 NotFoundInPanelCounter; SearchedPanel = pnlLeftColumn; NotFoundInPanelCounter = 0; while (1 == 1) { for (Counter1 = 0; Counter1 <= SearchedPanel.Controls.Count - 1; Counter1 += 1) { if (SearchedPanel.Controls[Counter1] is Panel) { if (SearchedPanel.Controls[Counter1].Name == "pnl" + ACriteriaName) { // Dehighlight the correct panel // MessageBox.Show('Dehighlighting Panel: ' + SearchedPanel.Controls[Counter1].Name ); SearchedPanel.Controls[Counter1].BackColor = SearchedPanel.Controls[Counter1].Parent.BackColor; if (!(FSelectedPanel == null)) { if ("pnl" + ACriteriaName == FSelectedPanel.SelectedCriteriaPanel.Name) { // Raise FindCriteriaSelectionChangedArgs event to signal that no criteria is selected FindCriteriaSelectionChangedArgs = new TPartnerFindCriteriaSelectionChangedEventArgs(); FindCriteriaSelectionChangedArgs.SelectedCriteria = null; FindCriteriaSelectionChangedArgs.CriteriaColumn = TFindCriteriaColumn.fccLeft; FindCriteriaSelectionChangedArgs.IsFirstInColumn = false; FindCriteriaSelectionChangedArgs.IsLastInColumn = false; // MessageBox.Show('Raising FindCriteriaSelectionChanged event.'); OnFindCriteriaSelectionChanged(FindCriteriaSelectionChangedArgs); FSelectedPanel = null; } } return true; } } } NotFoundInPanelCounter = NotFoundInPanelCounter + 1; if (NotFoundInPanelCounter == 1) { // Panel with matching name not found in pnlLeftColumn, try in pnlRightColumn SearchedPanel = pnlRightColumn; } else { // No panel with matching name found! return false; } } }
private void CorrespondingLabel_Click(System.Object sender, System.EventArgs e) { if (!((((System.Windows.Forms.Control)sender).Parent).Parent is UserControl)) { FSelectedPanel = SelectCriteriaPanel(((System.Windows.Forms.Control)sender).Name.Substring(3)); } else { // MessageBox.Show('Klicked on Panel in UC ''' + ((sender as System.Windows.Forms.Control).Parent).Parent.Name + ''', selecting Panel ''' + (((sender as System.Windows.Forms.Control).Parent).Parent).Parent.Name + '''.'); FSelectedPanel = SelectCriteriaPanel(((((System.Windows.Forms.Control)sender).Parent).Parent).Parent.Name.Substring(3)); (((UserControl)((System.Windows.Forms.Control)sender).Parent).Parent).BackColor = System.Drawing.SystemColors.InactiveCaption; } }