打印本文 打印本文 关闭窗口 关闭窗口
控件移动类的实现之二
作者:武汉SEO闵涛  文章来源:敏韬网  点击数6986  更新时间:2009/4/23 18:30:39  文章录入:mintao  责任编辑:mintao

//重定位控件的尽寸

procedure TDragClass.reSizeCon;

var Con:TControl;

begin

  Con:=TControl(FConList.Items[FCurActiveCon]);

  Con.Left:=FPointRec.LeftTop.Left+FPointRec.LeftTop.Width;

  Con.Top:=FPointRec.LeftTop.Top+FPointRec.LeftTop.Height;

  Con.Width:=FPointRec.RightTop.Left-Con.Left;

  Con.Height:=FPointRec.LeftBottom.Top-Con.Top;

end;

//-----------------------------------------------

//设置控件移动时是否用跳跃式的移动

procedure TDragClass.SetisMoveStep(value: Boolean);

begin

  if FisMoveStep<>value then

    FisMoveStep:=Value;

end;

//设置控件移动跳跃的距离

procedure TDragClass.SetMoveStep(value: integer);

begin

  if Value<5 then

     FMoveStep:=5

  else if Value>20 then

     FMoveStep:=20

  else

     FMoveStep:=Value;

end;

 

end.

 

到第三部分,用一个例子来说明这个类的用法

 << 上一页  [11] 

打印本文 打印本文 关闭窗口 关闭窗口