本文整理汇总了C#中PictureBox.Hide方法的典型用法代码示例。如果您正苦于以下问题:C# PictureBox.Hide方法的具体用法?C# PictureBox.Hide怎么用?C# PictureBox.Hide使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PictureBox
的用法示例。
在下文中一共展示了PictureBox.Hide方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddContextMenu
void AddContextMenu()
{
// The context menu
#region Picture Preview
Pic = new PictureBox(300, 300);
listResult.SelectedIndexChanged += (s, o) =>
{
if (ModifierKeys == Keys.Alt && listResult.SelectedIndices.Count == 1)
{
Pic.Location = new Point(Right, Top);
Pic.DisplayImage(DirectoryPath + listResult.SelectedItem);
}
else if (Pic != null)
{
Pic.Hide();
}
};
#endregion
var ctxMenu = new ContextMenuStrip();
#region Launch External
// Select ALL entry
var mnuLaunch = new ToolStripMenuItem("Launch External")
{
Image = new Bitmap([email protected])
};
mnuLaunch.Click += LaunchExternal;
ctxMenu.Items.Add(mnuLaunch);
#endregion
ctxMenu.Items.Add(new ToolStripSeparator());
#region SelectAll
// Select ALL entry
var mnuSelect = new ToolStripMenuItem("Select All")
{
Image = new Bitmap([email protected])
};
mnuSelect.Click += (sender, args) =>
{
for (int i = 0; i < listResult.Items.Count; i++)
{
listResult.SetSelected(i, true);
}
};
ctxMenu.Items.Add(mnuSelect);
#endregion
#region Invert Selection
// Select ALL entry
var mnuInvert = new ToolStripMenuItem("Select Other")
{
Image = new Bitmap(Properties.Resources.invert)
};
mnuInvert.Click += (sender, args) =>
{
for (int i = 0; i < listResult.Items.Count; i++)
{
listResult.SetSelected(i, !listResult.SelectedIndices.Contains(i));
}
};
ctxMenu.Items.Add(mnuInvert);
#endregion
ctxMenu.Items.Add(new ToolStripSeparator());
#region Export
// Export entry
var mnuExport = new ToolStripMenuItem("Export Selection")
{
Image = new Bitmap(Properties.Resources.save)
};
mnuExport.Click += ExportFiles;
ctxMenu.Items.Add(mnuExport);
#endregion
#region Delete
// Delete entry
var mnuDelete = new ToolStripMenuItem("Delete Selection")
{
Image = new Bitmap(Properties.Resources.delete)
};
mnuDelete.Click += DeleteFiles;
ctxMenu.Items.Add(mnuDelete);
#endregion
ctxMenu.Items.Add(new ToolStripSeparator());
#region Explore
// Explore entry
var mnuExplore = new ToolStripMenuItem("Explore Here")
{
Image = new Bitmap(Properties.Resources.explore)
};
mnuExplore.Click += ExploreHere;
ctxMenu.Items.Add(mnuExplore);
#endregion
//.........这里部分代码省略.........