本文整理汇总了C#中System.Windows.Forms.ToolStripDropDownButton.HideImageMargin方法的典型用法代码示例。如果您正苦于以下问题:C# ToolStripDropDownButton.HideImageMargin方法的具体用法?C# ToolStripDropDownButton.HideImageMargin怎么用?C# ToolStripDropDownButton.HideImageMargin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.ToolStripDropDownButton
的用法示例。
在下文中一共展示了ToolStripDropDownButton.HideImageMargin方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateMenu
//.........这里部分代码省略.........
tsbDeleteSelected = new ToolStripButton(Resources.ShapeManager_CreateContextMenu_Delete_selected_object);
tsbDeleteSelected.DisplayStyle = ToolStripItemDisplayStyle.Image;
tsbDeleteSelected.Image = Resources.layer__minus;
tsbDeleteSelected.MouseDown += (sender, e) => DeleteCurrentShape();
tsMain.Items.Add(tsbDeleteSelected);
tsbDeleteAll = new ToolStripButton(Resources.ShapeManager_CreateContextMenu_Delete_all_objects);
tsbDeleteAll.DisplayStyle = ToolStripItemDisplayStyle.Image;
tsbDeleteAll.Image = Resources.eraser;
tsbDeleteAll.MouseDown += (sender, e) => DeleteAllShapes();
tsMain.Items.Add(tsbDeleteAll);
#endregion Selected object
#region Capture
if (form.Mode != RegionCaptureMode.Editor)
{
tsMain.Items.Add(new ToolStripSeparator());
ToolStripButton tsbFullscreenCapture = new ToolStripButton(Resources.ShapeManager_CreateContextMenu_Capture_fullscreen);
tsbFullscreenCapture.DisplayStyle = ToolStripItemDisplayStyle.Image;
tsbFullscreenCapture.Image = Resources.layer_fullscreen;
tsbFullscreenCapture.MouseDown += (sender, e) => form.Close(RegionResult.Fullscreen);
tsMain.Items.Add(tsbFullscreenCapture);
ToolStripButton tsbActiveMonitorCapture = new ToolStripButton(Resources.ShapeManager_CreateContextMenu_Capture_active_monitor);
tsbActiveMonitorCapture.DisplayStyle = ToolStripItemDisplayStyle.Image;
tsbActiveMonitorCapture.Image = Resources.monitor;
tsbActiveMonitorCapture.MouseDown += (sender, e) => form.Close(RegionResult.ActiveMonitor);
tsMain.Items.Add(tsbActiveMonitorCapture);
ToolStripDropDownButton tsddbMonitorCapture = new ToolStripDropDownButton(Resources.ShapeManager_CreateContextMenu_Capture_monitor);
tsddbMonitorCapture.HideImageMargin();
tsddbMonitorCapture.DisplayStyle = ToolStripItemDisplayStyle.Image;
tsddbMonitorCapture.Image = Resources.monitor_window;
tsMain.Items.Add(tsddbMonitorCapture);
tsddbMonitorCapture.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.MouseDown += (sender, e) =>
{
form.MonitorIndex = index;
form.Close(RegionResult.Monitor);
};
tsddbMonitorCapture.DropDownItems.Add(tsmi);
}
}
#endregion Capture
#region Options
if (form.Mode != RegionCaptureMode.Editor)
{
tsMain.Items.Add(new ToolStripSeparator());
ToolStripDropDownButton tsddbOptions = new ToolStripDropDownButton(Resources.ShapeManager_CreateContextMenu_Options);
tsddbOptions.DisplayStyle = ToolStripItemDisplayStyle.Image;
示例2: CreateMenu
//.........这里部分代码省略.........
}
UpdateMenu();
UpdateCurrentShape();
}
}
ResumeForm();
};
tsMain.Items.Add(tsbFillColor);
tsbHighlightColor = new ToolStripButton(Resources.ShapeManager_CreateContextMenu_Highlight_color___);
tsbHighlightColor.DisplayStyle = ToolStripItemDisplayStyle.Image;
tsbHighlightColor.Click += (sender, e) =>
{
PauseForm();
using (ColorPickerForm dialogColor = new ColorPickerForm(AnnotationOptions.HighlightColor))
{
if (dialogColor.ShowDialog() == DialogResult.OK)
{
AnnotationOptions.HighlightColor = dialogColor.NewColor;
UpdateMenu();
UpdateCurrentShape();
}
}
ResumeForm();
};
tsMain.Items.Add(tsbHighlightColor);
tsddbShapeOptions = new ToolStripDropDownButton("Shape options");
tsddbShapeOptions.DisplayStyle = ToolStripItemDisplayStyle.Image;
tsddbShapeOptions.HideImageMargin();
tsddbShapeOptions.Image = Resources.layer__pencil;
tsMain.Items.Add(tsddbShapeOptions);
tslnudBorderSize = new ToolStripLabeledNumericUpDown(Resources.ShapeManager_CreateContextMenu_Border_size_);
tslnudBorderSize.Content.Minimum = 0;
tslnudBorderSize.Content.Maximum = 20;
tslnudBorderSize.Content.ValueChanged = (sender, e) =>
{
ShapeType shapeType = CurrentShapeType;
int borderSize = (int)tslnudBorderSize.Content.Value;
if (shapeType == ShapeType.DrawingText || shapeType == ShapeType.DrawingSpeechBalloon)
{
AnnotationOptions.TextBorderSize = borderSize;
}
else if (shapeType == ShapeType.DrawingStep)
{
AnnotationOptions.StepBorderSize = borderSize;
}
else
{
AnnotationOptions.BorderSize = borderSize;
}
UpdateCurrentShape();
};
tsddbShapeOptions.DropDownItems.Add(tslnudBorderSize);
tslnudCornerRadius = new ToolStripLabeledNumericUpDown(Resources.ShapeManager_CreateContextMenu_Corner_radius_);
tslnudCornerRadius.Content.Minimum = 0;
tslnudCornerRadius.Content.Maximum = 150;