本文整理匯總了C#中System.Windows.Forms.DragEventArgs.GetData方法的典型用法代碼示例。如果您正苦於以下問題:C# DragEventArgs.GetData方法的具體用法?C# DragEventArgs.GetData怎麽用?C# DragEventArgs.GetData使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Windows.Forms.DragEventArgs
的用法示例。
在下文中一共展示了DragEventArgs.GetData方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: empty_DragOver
private void empty_DragOver(object sender, DragEventArgs e)
{
if (e.IsDataPresent<ProviderTokenTileDragEventArgs>())
{
var args = e.GetData<ProviderTokenTileDragEventArgs>();
args.Location = new Point(e.X, e.Y);
}
OnDragOver(e);
}
示例2: empty_DragDrop
private void empty_DragDrop(object sender, DragEventArgs e)
{
if (!AllowDrop || !e.IsDataPresent<ProviderTokenTileDragEventArgs>())
return;
var args = e.GetData<ProviderTokenTileDragEventArgs>();
args.Location = new Point(e.X, e.Y);
if (args != null)
{
AboutToDrop(this, args);
if (!args.Cancel && !args.Handled)
Token = args.TokenTile.Token;
}
}
示例3: empty_DragEnter
private void empty_DragEnter(object sender, DragEventArgs e)
{
if (!AllowDrop || !e.IsDataPresent<ProviderTokenTileDragEventArgs>())
{
e.Effect = DragDropEffects.None;
return;
}
e.Effect = DragDropEffects.Copy;
var args = e.GetData<ProviderTokenTileDragEventArgs>();
Size sz = args.TokenTile.DisplayRectangle.Size;
Bitmap bm = new Bitmap(sz.Width, sz.Height);
using (var g = Graphics.FromImage(bm))
args.TokenTile.paint(g);
Cursor.Current = CreateCursor(bm, 0, 0);
bm.Dispose();
OnDragEnter(e);
}
示例4: _view_DragEnter
private void _view_DragEnter(object sender, DragEventArgs e)
{
ProviderTokenTile tile = sender as ProviderTokenTile;
if (!AllowDragArrange || _scrolling || tile == null || tile == _empty || !e.IsDataPresent<ProviderTokenTileDragEventArgs>())
return;
if (!_internalDrag)
{
var args = e.GetData<ProviderTokenTileDragEventArgs>();
args.TokenTile.QueryContinueDrag += new QueryContinueDragEventHandler(tile_QueryContinueDrag);
}
int index = _flow.Controls.IndexOf(tile);
_flow.Controls.Add(_empty);
_flow.Controls.SetChildIndex(_empty, index);
}