本文整理汇总了C#中System.Windows.Forms.QueryContinueDragEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# QueryContinueDragEventArgs类的具体用法?C# QueryContinueDragEventArgs怎么用?C# QueryContinueDragEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
QueryContinueDragEventArgs类属于System.Windows.Forms命名空间,在下文中一共展示了QueryContinueDragEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: listBox1_QueryContinueDrag
private void listBox1_QueryContinueDrag(object sender, QueryContinueDragEventArgs e)
{
if (e.EscapePressed)
{
e.Action = DragAction.Cancel;
}
}
示例2: OleQueryContinueDrag
public int OleQueryContinueDrag(int fEscapePressed, int grfKeyState)
{
QueryContinueDragEventArgs qcdevent = null;
bool escapePressed = fEscapePressed != 0;
DragAction cancel = DragAction.Continue;
if (escapePressed)
{
cancel = DragAction.Cancel;
}
else if ((((grfKeyState & 1) == 0) && ((grfKeyState & 2) == 0)) && ((grfKeyState & 0x10) == 0))
{
cancel = DragAction.Drop;
}
qcdevent = new QueryContinueDragEventArgs(grfKeyState, escapePressed, cancel);
this.peer.OnQueryContinueDrag(qcdevent);
switch (qcdevent.Action)
{
case DragAction.Drop:
return 0x40100;
case DragAction.Cancel:
return 0x40101;
}
return 0;
}
示例3: OleQueryContinueDrag
public int OleQueryContinueDrag(int fEscapePressed, int grfKeyState) {
QueryContinueDragEventArgs qcdevent = null;
bool escapePressed = (fEscapePressed != 0);
DragAction action = DragAction.Continue;
if (escapePressed) {
action = DragAction.Cancel;
}
else if ((grfKeyState & NativeMethods.MK_LBUTTON) == 0
&& (grfKeyState & NativeMethods.MK_RBUTTON) == 0
&& (grfKeyState & NativeMethods.MK_MBUTTON) == 0) {
action = DragAction.Drop;
}
qcdevent = new QueryContinueDragEventArgs(grfKeyState,escapePressed, action);
peer.OnQueryContinueDrag(qcdevent);
int hr = 0;
switch (qcdevent.Action) {
case DragAction.Drop:
hr = DragDropSDrop;
break;
case DragAction.Cancel:
hr = DragDropSCancel;
break;
}
return hr;
}
示例4: OnQueryContinueDrag
protected override void OnQueryContinueDrag(QueryContinueDragEventArgs qcdevent)
{
var pos = Parent.PointToClient(MousePosition);
if (!Bounds.Contains(pos))
{
qcdevent.Action = DragAction.Cancel;
return;
}
base.OnQueryContinueDrag(qcdevent);
}
示例5: OnQueryContinueDrag
/// <summary>
///
/// </summary>
/// <param name="args"></param>
protected override void OnQueryContinueDrag(QueryContinueDragEventArgs args)
{
base.OnQueryContinueDrag(args);
if (this.DropSink != null)
this.DropSink.QueryContinue(args);
}
示例6: OnQueryContinueDrag_ActionIsNotDropOrCancel
public void OnQueryContinueDrag_ActionIsNotDropOrCancel()
{
//Arrange
_control.IsMouseDown = true;
var eventArgs = new QueryContinueDragEventArgs(0, false, DragAction.Continue);
//Act
_control.OnQueryContinueDrag(null, eventArgs);
//Assert
Assert.IsTrue(_control.IsMouseDown);
}
示例7: OnQueryContinueDrag
protected virtual void OnQueryContinueDrag (QueryContinueDragEventArgs queryContinueDragEvent)
{
QueryContinueDragEventHandler eh = (QueryContinueDragEventHandler)(Events[QueryContinueDragEvent]);
if (eh != null)
eh (this, queryContinueDragEvent);
}
示例8: Form1_QueryContinueDrag
private void Form1_QueryContinueDrag(object sender, QueryContinueDragEventArgs e)
{
e.Action = DragAction.Continue;
}
示例9: OnQueryContinueDrag
bool IWorkflowDesignerMessageSink.OnQueryContinueDrag(QueryContinueDragEventArgs e)
{
try
{
OnQueryContinueDrag(e);
}
catch
{
}
return true;
}
示例10: OnQueryContinueDrag
/// <summary>
/// Check if we should continue dragging
/// </summary>
/// <param name="e"></param>
protected override void OnQueryContinueDrag(QueryContinueDragEventArgs e)
{
Rectangle screen = this.Parent.RectangleToScreen(new Rectangle(this.Location.X, this.Location.Y, this.Width, this.Height));
Point mousePoint = Cursor.Position;
// if ESC is pressed, always stop
if (e.EscapePressed == true || ((e.KeyState & 1) == 0 && screen.Contains(mousePoint) == false))
{
e.Action = DragAction.Cancel;
if (_draggedItem != null)
{
_draggedItem.Dragging = false;
this.RefreshItem(_draggedItem);
_draggedItem = null;
}
if (_draggedBitmap != null)
{
_draggedBitmap.Dispose();
_draggedBitmap = null;
this.Invalidate(_draggedBitmapRect);
}
_mouseDownLocation = Point.Empty;
}
else
{
DateTime now = DateTime.Now;
// if we are at the top or bottom, scroll every 150ms
if (mousePoint.Y >= screen.Bottom)
{
int visible = this.ClientSize.Height / this.ItemHeight;
int maxtopindex = Math.Max(this.Items.Count - visible + 1, 0);
if (this.TopIndex < maxtopindex && now.Subtract(_lastDragScroll).TotalMilliseconds >= 150)
{
this.TopIndex++;
_lastDragScroll = now;
this.Refresh();
}
}
else if (mousePoint.Y <= screen.Top)
{
int visible = this.ClientSize.Height / this.ItemHeight;
if (this.TopIndex > 0 && now.Subtract(_lastDragScroll).TotalMilliseconds >= 150)
{
this.TopIndex--;
_lastDragScroll = now;
this.Refresh();
}
}
_lastDragTopIndex = this.TopIndex;
base.OnQueryContinueDrag(e);
}
}
示例11: label1_QueryContinueDrag
//private void panel1_DragDrop(object sender, DragEventArgs e)
//{
// // int x = readerx;
// // int y = readery;
// try
// {
// DSSmartCity.Antenna_Row tagrow = (DSSmartCity.Antenna_Row)gridView3.GetFocusedDataRow();
// DSSmartCity.ReaderListRow readerrow = (DSSmartCity.ReaderListRow)gridView2.GetFocusedDataRow();
// foreach (Control item in panel1.Controls)
// {
// if (item.ToString()=="RfidTest.UCReader")
// {
// if (((UCReader)item).labelname== readerrow.name + ":"+tagrow.antennaid.ToString())
// {
// MessageBox.Show("This Antenna is already in the map.");
// return;
// }
// }
// }
// int x = PointToClient(Cursor.Position).X - this.panel1.Location.X - this.splitContainer1.Panel1.Width;// +scrollx;
// int y = PointToClient(Cursor.Position).Y - this.panel1.Location.Y;// +scrolly;
// this.panel1.SuspendLayout();
// this.SuspendLayout();
// // add the selected string to bottom of list
// Image im = Image.FromFile(@"photo/light.jpg"); // System.Drawing.Color.Lime;
// string readername = rfid1.ReaderList.Select("server='" + tagrow.readerid + "'")[0][1].ToString();
// UCReader mytag = new UCReader(im, readername + ":" + tagrow.antennaid);
// // PictureBox mytag = new PictureBox();
// // mytag.Image = im;
// mytag.AutoSize = true;
// mytag.Tag = "Reader";
// mytag.Location = new System.Drawing.Point(x, y);
// // mytag.Name = name.Split(',')[0].ToString();
// mytag.Size = new System.Drawing.Size(40, 60);
// // ((DSSmartCity.Antenna_Row)gridView3.GetFocusedDataRow()).x = x+scrollx;
// // ((DSSmartCity.Antenna_Row)gridView3.GetFocusedDataRow()).y = y+scrolly;
// mytag.BackColor = Color.White;
// mytag.MouseMove += new System.Windows.Forms.MouseEventHandler(this.label1_MouseMove);
// //if (rfid1.TagsPosition.Select("tagid='" + tagrow.readerid + "'").Length > 0)
// //{
// // MessageBox.Show("The Tag is existing!");
// //}
// //else
// //{
// // this.panel1.Controls.Add(mytag);
// // mytag.BringToFront();
// // this.panel1.PerformLayout();
// // this.ResumeLayout(false);
// // SaveData();
// //}
// // textBox1.SelectAll();
// }
// catch (Exception ex)
// {
// MessageBox.Show(ex.ToString());
// }
//}
private void label1_QueryContinueDrag(object sender, QueryContinueDragEventArgs e)
{
screenOffset = SystemInformation.WorkingArea.Location;
ListBox lb = sender as ListBox;
if (lb != null)
{
Form f = lb.FindForm();
// Cancel the drag if the mouse moves off the form. The screenOffset
// takes into account any desktop bands that may be at the top or left
// side of the screen.
if (((Control.MousePosition.X - screenOffset.X) < f.DesktopBounds.Left) ||
((Control.MousePosition.X - screenOffset.X) > f.DesktopBounds.Right) ||
((Control.MousePosition.Y - screenOffset.Y) < f.DesktopBounds.Top) ||
((Control.MousePosition.Y - screenOffset.Y) > f.DesktopBounds.Bottom))
{
e.Action = DragAction.Cancel;
}
}
eventCount = eventCount + 1; // increment event counter
}
示例12: pbPreview_QueryContinueDrag
private void pbPreview_QueryContinueDrag(object sender, QueryContinueDragEventArgs e)
{
//Trace.WriteLine("QueryContinueDrag...", "PeekPreview.pbPreview_QueryContinueDrag");
if (e.Action == DragAction.Continue)
{
DragThumb.SetDesktopLocation(Cursor.Position.X - DragThumb.Width / 2, Cursor.Position.Y - DragThumb.Height);
}
//else
//{
// DragThumb.Close();
//}
}
示例13: OnSourceListbox_QueryContinueDrag
//────────────────────────────────────────
/// <summary>
/// ドラッグ&ドロップ中に発生します。
/// ドラッグをキャンセルするのに使います。
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
public void OnSourceListbox_QueryContinueDrag(
object sender,
QueryContinueDragEventArgs e,
Log_Reports log_Reports
)
{
// ドラッグ中にマウスの右ボタンが押されていれば、ドラッグをキャンセルします。
// "2"は、マウスの右ボタンを表します。何故か定数はないようです。
if ((e.KeyState & 2) == 2)
{
e.Action = DragAction.Cancel;
}
}
示例14: Set_OnQueryContinueDragEventArgs
protected void Set_OnQueryContinueDragEventArgs(
Expression_Node_Function expr_Func,
object prm_Sender,
QueryContinueDragEventArgs prm_E
)
{
if (null != expr_Func)//暫定
{
expr_Func.EnumEventhandler = EnumEventhandler.O_Qcdea;
expr_Func.Functionparameterset.Sender = prm_Sender;
expr_Func.Functionparameterset.QueryContinueDragEventArgs = prm_E;
}
}
示例15: Execute4_OnQueryContinueDragEventArgs
//────────────────────────────────────────
/// <summary>
/// ドラッグ&ドロップ用アクション実行。
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
public override void Execute4_OnQueryContinueDragEventArgs(
object prm_Sender,
QueryContinueDragEventArgs prm_E
)
{
Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static);
Log_Reports log_Reports_Master = new Log_ReportsImpl(log_Method);
log_Method.BeginMethod(Info_Expr.Name_Library, this, "Execute4_OnQueryContinueDragEventArgs", log_Reports_Master);
//
//
// イベントハンドラー引数の設定
this.Set_OnQueryContinueDragEventArgs(
this,
prm_Sender,
prm_E
);
this.Execute5_Main(log_Reports_Master);
log_Method.EndMethod(log_Reports_Master);
}