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();
}
}
}
c#按键的拖拽模板代码
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。
推荐阅读更多精彩内容
- Xamarin XAML语言教程构建ControlTemplate控件模板 控件模板ControlTemplate...
- 为了实现和很久以前在土豆网上按出"上上下下左右左右吧"指令后弹出的特效效果.在网上找了很久都没有找到它的代码.所以...