在页面写一个panel,用户可以通过按钮来添加lable,然后可以通过拖拽的形式来控制大小和位置
最后panel的位置不一定是固定的,用一个类来实现上述的方法。
最后panel的位置不一定是固定的,用一个类来实现上述的方法。
解决方案 »
- wpf webapplication 录音
- 学习c#的winform,应该先学c#的面向对象吗?
- 如果comboBox像textBox一样来使用,怎样限制comboBox只能输入中文
- excel图表会自动设置最大刻度值、最小刻度值、主要刻度单位、次要刻度单位,请问是怎样计算的?
- 如果DataGrid中的数据很多,超出窗体的面积,怎么使鼠标在DataGrid行标题栏上拖动时让选中的行也跟着下移
- 关于C#数组的问题
- asp.net1.1程序转换asp.net 2.0后,分页控件事件无法触发
- 有一个问题困了我好多天了。哪位高手有自信的话把信箱留下我把程序发过去。UP有分。。。
- C#的奇怪問題..............
- 关于excel
- 用C#开发PDA移动设备,如何直接连接SQL Server 2005 数据库?
- 怎样使用ghostscript API 把PDF文件转化成TIFF文件呢?用C#实现
private Point lastMsPoint;
private Size lastSize;
private void label1_MouseDown(object sender, MouseEventArgs e)
{
this.lastLocation = this.label1.Location;
this.lastSize = this.label1.Size;
this.lastMsPoint = Control.MousePosition;
}private void label1_MouseMove(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
Point mp = Control.MousePosition;
if ((ModifierKeys & Keys.Control) == Keys.Control)
{
this.label1.Size = new Size(this.lastSize.Width + mp.X - this.lastMsPoint.X, this.lastSize.Height + mp.Y - this.lastMsPoint.Y);
}
else
{
this.label1.Location = new Point(this.lastLocation.X + mp.X - this.lastMsPoint.X, this.lastLocation.Y + mp.Y - this.lastMsPoint.Y);
}
}
}
例如:reSize(控件名,容器名)