0
点赞
收藏
分享

微信扫一扫

c#按键的拖拽模板代码

吴wuwu 2022-11-24 阅读 59


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();
}
}
}

举报

相关推荐

0 条评论