本文整理汇总了C#中Keys.HasFlagUnchecked方法的典型用法代码示例。如果您正苦于以下问题:C# Keys.HasFlagUnchecked方法的具体用法?C# Keys.HasFlagUnchecked怎么用?C# Keys.HasFlagUnchecked使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Keys
的用法示例。
在下文中一共展示了Keys.HasFlagUnchecked方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MainForm_MouseMove
/*
private void MainForm_MouseMove(object sender, MouseEventArgs e)
{
if (e.X == mainPictureBox.Location.X + mainPictureBox.Size.Width)
{
Cursor.Current = Cursors.SizeWE;
}
}
private void MainTreeView_SizeChanged(object sender, EventArgs e)
{
float widthDiff = mainTreeView.Bounds.Width - _lastMainTreeViewSize.Width;
MoveDockedObject(mainPictureBox, (int)widthDiff * 2, 0);
MoveDockedObject(mainPropertyGrid, (int)widthDiff * 2, 0);
if (mainPictureBox.Bounds.IntersectsWith(mainTreeView.Bounds) || mainPropertyGrid.Bounds.IntersectsWith(mainTreeView.Bounds))
{
MoveDockedObject(mainPictureBox, -2, 0);
MoveDockedObject(mainPropertyGrid, -2, 0);
}
_lastMainTreeViewSize = mainTreeView.Bounds;
}
private void MoveDockedObject(Control control, int width, int height)
{
Rectangle old = control.Bounds;
old.X += width;
old.Y += height;
control.Bounds = old;
}
*/
// Handlers
private void HandleTreeViewCtrlShortcuts(Keys keys)
{
ResourceWrapper res = (ResourceWrapper)mainTreeView.SelectedNode;
// Move up
if (keys.HasFlagUnchecked(Keys.Up))
{
if (res.CanMove)
{
res.MoveUp(this, EventArgs.Empty);
}
}
// Move down
else if (keys.HasFlagUnchecked(Keys.Down))
{
if (res.CanMove)
{
res.MoveDown(this, EventArgs.Empty);
}
}
// Delete
else if (keys.HasFlagUnchecked(Keys.Delete))
{
if (res.CanDelete)
{
res.Delete(this, EventArgs.Empty);
}
}
// Replace
else if (keys.HasFlagUnchecked(Keys.R))
{
if (res.CanReplace)
{
res.Replace(this, EventArgs.Empty);
}
}
// Rename
else if (keys.HasFlagUnchecked(Keys.E))
{
if (res.CanRename)
{
res.Export(this, EventArgs.Empty);
}
}
}