private void DropdownButton_Click(object sender, EventArgs e) { if (popupMenu != null) { Point p = new Point(); p.X = this.Location.X; p.Y = this.Location.Y + this.Size.Height; popupMenu.ShowPopup(p); } }
private void tagTree_MouseUp(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Right) { if (popupMenu != null) { popupMenu.ShowPopup(Control.MousePosition); } } }
void treeBinding_MouseDown(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Right && ModifierKeys == Keys.None && treeBinding.State == TreeListState.Regular) { Point pt = treeBinding.PointToClient(MousePosition); TreeListHitInfo info = treeBinding.CalcHitInfo(pt); if (info.Node != null) { treeBinding.FocusedNode = info.Node; } ContextMenu.ShowPopup(MousePosition); } }
void DataConfigTreeCtrl_MouseUp(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Right && ModifierKeys == Keys.None && DataConfigTreeCtrl.State == TreeListState.Regular) { Point pt = DataConfigTreeCtrl.PointToClient(MousePosition); TreeListHitInfo info = DataConfigTreeCtrl.CalcHitInfo(pt); if (info.Node != null) { DataConfigTreeCtrl.FocusedNode = info.Node; } ContextMenu.ShowPopup(MousePosition); } }
private void gridView1_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e) { if (e.Button == MouseButtons.Right) { GridView view = sender as GridView; GridHitInfo info = view.CalcHitInfo(new Point(e.X, e.Y)); if (info.HitTest == GridHitTest.RowCell && info.Column.FieldName == "Category" && view.IsRowSelected(info.RowHandle)) { barEditItem1.EditValue = null; popupMenu1.ShowPopup(MousePosition); } } }
private void repositoryItemButtonEdit1_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) { if (e.Button.Kind == ButtonPredefines.Ellipsis) { MessageBox.Show("This is a dialog box."); } if (e.Button.Kind == ButtonPredefines.Combo) { ButtonEdit editor = sender as ButtonEdit; ButtonEditViewInfo evi = editor.GetViewInfo() as ButtonEditViewInfo; EditorButtonObjectInfoArgs bvi = evi.ButtonInfoByButton(e.Button); Point pt = new Point(bvi.Bounds.Left, bvi.Bounds.Bottom); pt = editor.PointToScreen(pt); popupMenu1.ShowPopup(pt); } }
void treeList1_MouseClick(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Right && ModifierKeys == Keys.None && treeList1.State == TreeListState.Regular) { Point pt = this.PointToClient(MousePosition); TreeListHitInfo info = treeList1.CalcHitInfo(pt); if (info.HitInfoType == HitInfoType.Cell || info.HitInfoType == HitInfoType.StateImage) { treeList1.FocusedNode = info.Node; ABCCommonTreeListNode obj = (ABCCommonTreeListNode)treeList1.GetDataRecordByNode(treeList1.FocusedNode); if (obj == null || (DataStructInfo)obj.InnerData == null) { return; } DataStructInfo data = (DataStructInfo)obj.InnerData; if (DataStructureProvider.IsForeignKey(data.TableName, data.FieldName)) { ContextMenu.ShowPopup(MousePosition); } } } else if (e.Button == MouseButtons.Left && ModifierKeys == Keys.None && treeList1.State == TreeListState.NodePressed) { ABCCommonTreeListNode obj = (ABCCommonTreeListNode)treeList1.GetDataRecordByNode(treeList1.FocusedNode); if (obj == null || (DataStructInfo)obj.InnerData == null) { return; } (obj.InnerData as DataStructInfo).Selected = !(obj.InnerData as DataStructInfo).Selected; if ((obj.InnerData as DataStructInfo).Selected) { foreach (DataStructInfo data in lstData) { if (data != (obj.InnerData as DataStructInfo) && data.TotalFieldName != (obj.InnerData as DataStructInfo).TotalFieldName) { data.Selected = false; } } } treeList1.RefreshDataSource(); } }
protected virtual void Export() { if (btnExport.Visibility == DevExpress.XtraBars.BarItemVisibility.Never || this.btnExport.Enabled == false) { return; } DevExpress.XtraBars.PopupMenu menu = new DevExpress.XtraBars.PopupMenu(); // Bind the menu to a bar manager. menu.Manager = barManager1; // Add two items that belong to the bar manager. menu.ItemLinks.Add(btnExcel); menu.ItemLinks.Add(btnExcelXlsx); menu.ItemLinks.Add(btnPdf); menu.ItemLinks.Add(btnText); menu.ItemLinks.Add(btnHtml); menu.ItemLinks.Add(btnCSV); this.btnExport.DropDownControl = menu; int index = bar3.ItemLinks.Count - 3 < 0 ? 0 : bar3.ItemLinks.Count - 3; System.Drawing.Rectangle rec = bar3.ItemLinks[index].ScreenBounds; menu.ShowPopup(new System.Drawing.Point(rec.X, rec.Y)); }
void FieldBindingTree_MouseDown(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Right && ModifierKeys == Keys.None && this.State == TreeListState.Regular) { Point pt = this.PointToClient(MousePosition); TreeListHitInfo info = this.CalcHitInfo(pt); if (info.HitInfoType == HitInfoType.Cell || info.HitInfoType == HitInfoType.StateImage) { this.FocusedNode = info.Node; ABCCommonTreeListNode obj = (ABCCommonTreeListNode)this.GetDataRecordByNode(this.FocusedNode); if (obj == null || (FieldNodeInfo)obj.InnerData == null) { return; } FieldNodeInfo data = (FieldNodeInfo)obj.InnerData; if (data.Type == FiledNodeType.Foreign) { ContextMenu.ShowPopup(MousePosition); } } } }