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


C# ToolStripDropDownItem.ShowDropDown方法代码示例

本文整理汇总了C#中System.Windows.Forms.ToolStripDropDownItem.ShowDropDown方法的典型用法代码示例。如果您正苦于以下问题:C# ToolStripDropDownItem.ShowDropDown方法的具体用法?C# ToolStripDropDownItem.ShowDropDown怎么用?C# ToolStripDropDownItem.ShowDropDown使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Forms.ToolStripDropDownItem的用法示例。


在下文中一共展示了ToolStripDropDownItem.ShowDropDown方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: shadingModes_ensureToolStripItems

        private void shadingModes_ensureToolStripItems(ToolStripDropDownItem targetToolStrip, int minCount = 1, int toolStipInsertionIndex = 0)
        {
            Debug.Assert(targetToolStrip.DropDownItems != null);

              // First time - Third Item is separator
              if (targetToolStrip.DropDownItems.Count < minCount)
              {
            // Insert normal shading mode
            ShadingEffectMenuItem item = new ShadingEffectMenuItem(
              ShadingEffectMenuItem.NORMAL_SHADING_STRING, ShadingEffectMenuItem.NORMAL_SHADING_INDEX, targetToolStrip);

            item.BeforeChangingShadingMode += normalShadingItem_BeforeChangingShadingMode;
            item.AfterChangingShadingMode += new ShadingEffectMenuItem.ShadingModeChanged(item_AfterChangingShadingMode);
            targetToolStrip.DropDownItems.Insert(toolStipInsertionIndex, item);

            // Add all rendering effects that are loaded by the engine manager for this purpose:
            VisionEngineManager em = (VisionEngineManager)EditorManager.EngineManager;
            StringCollection names = new StringCollection();
            em.GetReplacementRenderLoopEffects(names);

            // Insert shading items
            for (int i = 0; i < names.Count; i++)
            {
              ShadingEffectMenuItem shadingMenuItem = new ShadingEffectMenuItem(
            names[i], ShadingEffectMenuItem.NORMAL_SHADING_INDEX + 1 + i, targetToolStrip);
              shadingMenuItem.AfterChangingShadingMode += new ShadingEffectMenuItem.ShadingModeChanged(item_AfterChangingShadingMode);
              targetToolStrip.DropDownItems.Insert(i + toolStipInsertionIndex + 1, shadingMenuItem);
            }

            // Add a check box for particle debug rendering on/off.
            targetToolStrip.DropDownItems.Add(new ToolStripSeparator());
            VisionEngineManager visionEngineManager = (VisionEngineManager)EditorManager.EngineManager;
            ToolStripMenuItem particleDebugRendering = new ToolStripMenuItem("Particle Debug Rendering", global::Editor.Properties.Resources.view_particle_debug);
            particleDebugRendering.Click += (System.EventHandler)((sender, arg) =>
              {
            visionEngineManager.ParticleDebugRendering = !visionEngineManager.ParticleDebugRendering;
            ((ToolStripMenuItem)sender).Checked = visionEngineManager.ParticleDebugRendering;
            // Keep menu open.
            if (targetToolStrip.GetType() == typeof(ToolStripSplitButton))
            {
              EditorManager.ActiveView.UpdateView(true);
              targetToolStrip.ShowDropDown();
            }
              });
            particleDebugRendering.ImageScaling = ToolStripItemImageScaling.None;
            particleDebugRendering.Checked = visionEngineManager.ParticleDebugRendering;
            targetToolStrip.DropDownItems.Add(particleDebugRendering);
              }
        }
开发者ID:elemen,项目名称:projectanarchy,代码行数:49,代码来源:EnginePanel.cs


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