首页 > 编程语言 >c#按键的拖拽模板代码

c#按键的拖拽模板代码

时间:2022-11-24 13:01:43浏览次数:36  
标签:control mousePos c# GetFrame getX getStringValue keyEntry 拖拽 模板


public void BtnMove(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{

if (!mAllowDragKey)
{
return;
}
Point mousePos = Control.MousePosition;
mousePos.Offset(mouse_offset.X, mouse_offset.Y);
KeyButton control = (KeyButton)sender;
control.Location = control.Parent.PointToClient(mousePos);
keepLocationShow(control);

control.keyEntry.GetFrame().getX().setValue(control.Left);
control.keyEntry.GetFrame().getY().setValue(control.Top);
codeSetModeing = true;
textBox_current_key_left.Text = control.keyEntry.GetFrame().getX().getStringValue();
textBox_current_key_top.Text = control.keyEntry.GetFrame().getY().getStringValue();
if (mAutoChangeMode)
{
jsonObject2Text();
}
}
}

标签:control,mousePos,c#,GetFrame,getX,getStringValue,keyEntry,拖拽,模板
From: https://blog.51cto.com/u_15458814/5883463

相关文章