当前位置: 首页>>代码示例>>C#>>正文


C# ContextMenuStrip.FindForm方法代码示例

本文整理汇总了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;
        }
开发者ID:khanhdtn,项目名称:my-fw-win,代码行数:30,代码来源:HelpInPhieu.cs

示例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;
        }
开发者ID:khanhdtn,项目名称:my-fw-win,代码行数:30,代码来源:HelpNghiepVu.cs

示例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"));
			}
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:22,代码来源:FwProjPropertiesDlg.cs


注:本文中的System.Windows.Forms.ContextMenuStrip.FindForm方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。