本文整理汇总了C#中System.Windows.Forms.ContextMenuStrip.FindForm方法的典型用法代码示例。如果您正苦于以下问题:C# ContextMenuStrip.FindForm方法的具体用法?C# ContextMenuStrip.FindForm怎么用?C# ContextMenuStrip.FindForm使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.ContextMenuStrip
的用法示例。
在下文中一共展示了ContextMenuStrip.FindForm方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InitInPhieu
public static List<Object> InitInPhieu(ContextMenuStrip mnuIn, PLCPhieu Phieu, IDDOPhieu DOData)
{
List<object> items = new List<object>();
System.Windows.Forms.ToolStripMenuItem item;
item = new System.Windows.Forms.ToolStripMenuItem();
item.Name = "itemXemTruocKhiIn";
item.Text = "Xem trước khi in";
item.Click += delegate(object sender, EventArgs e)
{
Phieu.GetPrintObj((XtraForm)mnuIn.FindForm(), new long[] { DOData.GetID() }).execPreviewWith();
};
mnuIn.Items.Add(item);
ApplyPermissionAction.ApplyPermissionObject(items, item, Phieu.GetPhieuType().AllowIn);
//Perm.Add(Phieu.GetPhieuType().AllowIn);
item = new System.Windows.Forms.ToolStripMenuItem();
item.Name = "itemIn";
item.Text = "In";
item.Click += delegate(object sender, EventArgs e)
{
Phieu.GetPrintObj((XtraForm)mnuIn.FindForm(), new long[] { DOData.GetID() }).execDirectlyPrint();
};
mnuIn.Items.Add(item);
ApplyPermissionAction.ApplyPermissionObject(items, item, Phieu.GetPhieuType().AllowIn);
//Perm.Add(Phieu.GetPhieuType().AllowIn);
return items;
}
示例2: InitNghiepVu
//Còn vấn đề phân quyền
public static List<Object> InitNghiepVu(ContextMenuStrip mnuNghiepVu, PhieuType PhieuFrom, object DOData)
{
List<Object> list = new List<Object>();
List<PhieuType> Phieus = PhieuFrom.CanCreateList;
ToolStripMenuItem[] Items = new ToolStripMenuItem[Phieus.Count];
for (int i = 0; i < Phieus.Count; i++)
{
PhieuType PhieuTo = Phieus[i];
ToolStripMenuItem item = new ToolStripMenuItem();
item.Name = PhieuTo.GetDOName();
//this.item.Size = new System.Drawing.Size(286, 22);
item.Text = "Tạo " + PhieuTo.GetTitle();
item.Click += delegate(object sender, EventArgs e)
{
ProtocolForm.ShowModalForm((XtraForm)mnuNghiepVu.FindForm(), PhieuTo.GetFormClassName(), DOData);
};
Items[i] = item;
ApplyPermissionAction.ApplyPermissionObject(list, Items[i], PhieuTo.AllowAdd);
//list.Add(PhieuTo.AllowAdd);
}
if (Items.Length == 0)
mnuNghiepVu.Visible = false;
else
mnuNghiepVu.Items.AddRange(Items);
return list;
}
示例3: ShowAddWsContextMenu
static internal void ShowAddWsContextMenu(ContextMenuStrip cmnuAddWs,
IEnumerable<IWritingSystem> wssToAdd, ListBox listToAddTo, Button button,
EventHandler clickHandlerExistingWs, EventHandler clickHandlerNewWs,
EventHandler clickHandlerNewWsFromSelected, IWritingSystem selectedWs)
{
try
{
PopulateWsContextMenu(cmnuAddWs, wssToAdd, listToAddTo, clickHandlerExistingWs, clickHandlerNewWs,
clickHandlerNewWsFromSelected, selectedWs);
cmnuAddWs.Show(button, new Point(0, button.Height));
}
catch (Exception e)
{
Form form = cmnuAddWs.FindForm();
Control owner = null;
if (form != null)
owner = form.Owner;
MessageBoxUtils.Show(owner,
string.Format(ResourceHelper.GetResourceString("kstidMiscErrorWithMessage"), e.Message),
ResourceHelper.GetResourceString("kstidMiscError"));
}
}