本文整理汇总了C#中System.Windows.Forms.ToolStripMenuItem.HideImageMargin方法的典型用法代码示例。如果您正苦于以下问题:C# ToolStripMenuItem.HideImageMargin方法的具体用法?C# ToolStripMenuItem.HideImageMargin怎么用?C# ToolStripMenuItem.HideImageMargin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.ToolStripMenuItem
的用法示例。
在下文中一共展示了ToolStripMenuItem.HideImageMargin方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddEffectToContextMenu
private void AddEffectToContextMenu(string groupName, params Type[] imageEffects)
{
ToolStripMenuItem tsmiParent = new ToolStripMenuItem(groupName);
tsmiParent.HideImageMargin();
cmsEffects.Items.Add(tsmiParent);
foreach (Type imageEffect in imageEffects)
{
ToolStripItem tsmiChild = tsmiParent.DropDownItems.Add(imageEffect.GetDescription().Replace("&", "&&"));
tsmiChild.Tag = imageEffect;
tsmiChild.Click += tsmiEffectClick;
}
}
示例2: CreateToolbar
//.........这里部分代码省略.........
tsMain.Items.Add(tsddbCapture);
tsmiRegionCapture = new ToolStripMenuItem("Capture regions");
tsmiRegionCapture.Image = Resources.layer;
tsmiRegionCapture.ShortcutKeyDisplayString = "Enter";
tsmiRegionCapture.MouseDown += (sender, e) =>
{
form.UpdateRegionPath();
form.Close(RegionResult.Region);
};
tsddbCapture.DropDownItems.Add(tsmiRegionCapture);
if (RegionCaptureForm.LastRegionFillPath != null)
{
ToolStripMenuItem tsmiLastRegionCapture = new ToolStripMenuItem("Capture last region");
tsmiLastRegionCapture.Image = Resources.layers;
tsmiLastRegionCapture.MouseDown += (sender, e) => form.Close(RegionResult.LastRegion);
tsddbCapture.DropDownItems.Add(tsmiLastRegionCapture);
}
ToolStripMenuItem tsmiFullscreenCapture = new ToolStripMenuItem(Resources.ShapeManager_CreateContextMenu_Capture_fullscreen);
tsmiFullscreenCapture.Image = Resources.layer_fullscreen;
tsmiFullscreenCapture.ShortcutKeyDisplayString = "Space";
tsmiFullscreenCapture.MouseDown += (sender, e) => form.Close(RegionResult.Fullscreen);
tsddbCapture.DropDownItems.Add(tsmiFullscreenCapture);
ToolStripMenuItem tsmiActiveMonitorCapture = new ToolStripMenuItem(Resources.ShapeManager_CreateContextMenu_Capture_active_monitor);
tsmiActiveMonitorCapture.Image = Resources.monitor;
tsmiActiveMonitorCapture.ShortcutKeyDisplayString = "~";
tsmiActiveMonitorCapture.MouseDown += (sender, e) => form.Close(RegionResult.ActiveMonitor);
tsddbCapture.DropDownItems.Add(tsmiActiveMonitorCapture);
ToolStripMenuItem tsmiMonitorCapture = new ToolStripMenuItem(Resources.ShapeManager_CreateContextMenu_Capture_monitor);
tsmiMonitorCapture.HideImageMargin();
tsmiMonitorCapture.Image = Resources.monitor_window;
tsddbCapture.DropDownItems.Add(tsmiMonitorCapture);
Screen[] screens = Screen.AllScreens;
for (int i = 0; i < screens.Length; i++)
{
Screen screen = screens[i];
ToolStripMenuItem tsmi = new ToolStripMenuItem($"{screen.Bounds.Width}x{screen.Bounds.Height}");
tsmi.ShortcutKeyDisplayString = (i + 1).ToString();
int index = i;
tsmi.MouseDown += (sender, e) =>
{
form.MonitorIndex = index;
form.Close(RegionResult.Monitor);
};
tsmiMonitorCapture.DropDownItems.Add(tsmi);
}
#endregion Capture
#region Options
ToolStripDropDownButton tsddbOptions = new ToolStripDropDownButton(Resources.ShapeManager_CreateContextMenu_Options);
tsddbOptions.DisplayStyle = ToolStripItemDisplayStyle.Image;
tsddbOptions.Image = Resources.gear;
tsMain.Items.Add(tsddbOptions);
tsmiQuickCrop = new ToolStripMenuItem(Resources.ShapeManager_CreateContextMenu_Multi_region_mode);
tsmiQuickCrop.Checked = !Config.QuickCrop;
tsmiQuickCrop.CheckOnClick = true;
tsmiQuickCrop.ShortcutKeyDisplayString = "Q";
示例3: CreateContextMenu
//.........这里部分代码省略.........
PauseForm();
using (ColorPickerForm dialogColor = new ColorPickerForm(AnnotationOptions.HighlightColor))
{
if (dialogColor.ShowDialog() == DialogResult.OK)
{
AnnotationOptions.HighlightColor = dialogColor.NewColor;
UpdateContextMenu();
UpdateCurrentShape();
}
}
ResumeForm();
};
cmsContextMenu.Items.Add(tsmiHighlightColor);
#endregion Shape options
#region Capture
cmsContextMenu.Items.Add(new ToolStripSeparator());
ToolStripMenuItem tsmiFullscreenCapture = new ToolStripMenuItem("Capture fullscreen");
tsmiFullscreenCapture.Image = Resources.layer_fullscreen;
tsmiFullscreenCapture.Click += (sender, e) => form.Close(RegionResult.Fullscreen);
cmsContextMenu.Items.Add(tsmiFullscreenCapture);
ToolStripMenuItem tsmiActiveMonitorCapture = new ToolStripMenuItem("Capture active monitor");
tsmiActiveMonitorCapture.Image = Resources.monitor;
tsmiActiveMonitorCapture.Click += (sender, e) => form.Close(RegionResult.ActiveMonitor);
cmsContextMenu.Items.Add(tsmiActiveMonitorCapture);
ToolStripMenuItem tsmiMonitorCapture = new ToolStripMenuItem("Capture monitor");
tsmiMonitorCapture.HideImageMargin();
tsmiMonitorCapture.Image = Resources.monitor_window;
cmsContextMenu.Items.Add(tsmiMonitorCapture);
tsmiMonitorCapture.DropDownItems.Clear();
Screen[] screens = Screen.AllScreens;
for (int i = 0; i < screens.Length; i++)
{
Screen screen = screens[i];
ToolStripMenuItem tsmi = new ToolStripMenuItem(string.Format("{0}. {1}x{2}", i + 1, screen.Bounds.Width, screen.Bounds.Height));
int index = i;
tsmi.Click += (sender, e) =>
{
form.MonitorIndex = index;
form.Close(RegionResult.Monitor);
};
tsmiMonitorCapture.DropDownItems.Add(tsmi);
}
#endregion Capture
#region Options
cmsContextMenu.Items.Add(new ToolStripSeparator());
ToolStripMenuItem tsmiOptions = new ToolStripMenuItem("Options");
tsmiOptions.Image = Resources.gear;
cmsContextMenu.Items.Add(tsmiOptions);
ToolStripMenuItem tsmiQuickCrop = new ToolStripMenuItem("Multi region mode");
tsmiQuickCrop.Checked = !Config.QuickCrop;