有谁知道!告诉我啊

likefxy 2009-09-11 03:21:35
在创建窗体后 我们放上去的一个BUTTON ,当我们选中时,BUTTON的四周会呈现8个可以拉动小园点!

我现在想问的是,在运行窗体后! 当我点击BUTTON时 怎么才能也呈现出那8个可以拉动小圆点,
谁做过这样的东西! 给说下 有C#自己写好的方法吗?

自己写的也可以 代码给发来看看!
...全文
56 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
zhaigates 2009-09-11
  • 打赏
  • 举报
回复
不错,好东东
visionary0812 2009-09-11
  • 打赏
  • 举报
回复
网上查 益智类小游戏
qlzf11140820 2009-09-11
  • 打赏
  • 举报
回复
别样苍茫 2009-09-11
  • 打赏
  • 举报
回复
WinForms如何拖动,移动控件
using System; 
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace moveControls
{
public partial class badnewfish : Form
{
private int tmpx = 0;
private int tmpy = 0;
//定义一个逻辑值,用于判断鼠标是否按下,如果按下鼠标的同时移动鼠标才会对控件起作用
private bool x = false;
public badnewfish()
{
InitializeComponent();

}
//当按下鼠标时,记录当前鼠标的坐标值
private void button1_MouseDown(object sender, MouseEventArgs e)
{
//标记鼠标按下状态
x = true;
this.tmpx = e.X;
this.tmpy = e.Y;

}
//当释放鼠标时发生的事件
private void button1_MouseUp(object sender, MouseEventArgs e)
{
//标记鼠标未按下状态
x = false;
}

//当鼠标移动时计算当前应该的坐标值并且重新绘制
private void button1_MouseMove(object sender, MouseEventArgs e)
{
if (x)
this.button1.Location = new System.Drawing.Point(this.button1.Location.X
+ e.X - this.tmpx, this.button1.Location.Y + e.Y - this.tmpy);
this.button1.Refresh();

}

}
}

110,526

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧