protected virtual void OnActiveFilesButtonClick(object sender, ActiveFilesButtonClickEventArgs e) { Form parentForm = this.MdiParent; if (parentForm == null) { return; } DXPopupMenu activeFilesPopupMenu = CreateActiveFilesPopupMenu(); foreach (XtraMdiTabPage page in this.Pages) { if (!page.PageVisible || !page.PageEnabled) { continue; } DXMenuItem menuItem = CreateMenuItem(page); menuItem.Click += new EventHandler(OnActiveFilesButtonMenuItemClick); activeFilesPopupMenu.Items.Add(menuItem); } IXtraTab xtraTabIntf = this as IXtraTab; if (xtraTabIntf == null) { return; } Point menuPos = new Point(e.ButtonInfo.Bounds.X, e.ButtonInfo.Bounds.Bottom); MenuManagerHelper.GetMenuManager(xtraTabIntf.LookAndFeel).ShowPopupMenu(activeFilesPopupMenu, parentForm, menuPos); }
private void personSelector_ButtonPressed(object sender, ButtonPressedEventArgs e) { if (e.Button.Index == recentButton.Index) { if (recentMenu.OwnerPopup != null) { recentMenu.HidePopup(); } else { var evi = personSelector.GetViewInfo() as ButtonEditViewInfo; var bvi = evi.ButtonInfoByButton(e.Button); var pt = new Point(bvi.Bounds.Left, bvi.Bounds.Bottom); MenuManagerHelper.GetMenuManager(LookAndFeel).ShowPopupMenu(recentMenu, personSelector, pt); } } }