private void SelectedDataButton_Click(object sender, EventArgs e) { // show dropdown list of selected tables if (Tabs.TabPages.Count == 0) { return; } TableListForm = new TableList(); for (int i1 = 0; i1 < Tabs.TabPages.Count; i1++) { XtraTabPage tp = Tabs.TabPages[i1]; TableListForm.List.Items.Add(tp.Text); if (Tabs.SelectedTabPageIndex == i1) { TableListForm.List.SelectedIndex = TableListForm.List.Items.Count - 1; } } Point p = SelectedDataButton.PointToScreen(new Point(0, SelectedDataButton.Height)); TableListForm.Left = p.X; TableListForm.Top = p.Y; TableListForm.SelectedMethod = new System.EventHandler(this.SelectedDataLabelMenuItem_Click); TableListForm.Show(SessionManager.ActiveForm); return; }
/// <summary> /// Show dropdown list of table names to choose from to scroll to /// </summary> /// <param name="sender"></param> /// <param name="e"></param> internal void ShowTableListDropDown(Point location) { TableList = new TableList(); BandCaptionDict = new Dictionary <string, int>(); BandedGridView v = MoleculeGridPanel.BandedViewGrid.V as BandedGridView; if (v == null) { return; } for (int i1 = 0; i1 < v.Bands.Count; i1++) { // scan top row for table labels string txt = v.Bands[i1].Caption; if (txt == null) { continue; } txt = txt.Replace(" ", " "); if (txt.Length <= 1) { continue; } if (BandCaptionDict.ContainsKey(txt)) { continue; } BandCaptionDict[txt] = i1; // store band index TableList.List.Items.Add(txt); } BandCaptionDict = BandCaptionDict; TableList.Location = location; TableList.List.SelectedIndexChanged += new System.EventHandler(TableList_List_SelectedIndexChanged); TableList.Show(); }