1 记下两个控件的Top,Left,Right(计算),Bottom(计算)。
2 当鼠标移动时,判断:
Accept1:=(Top2<Botton1)or(Botton2>Top1);
Accept2:=(Left2>Right1)or(Right2<Left1);
if Accept1 and Accept2 then 不重叠.
1 记下两个控件的Top,Left,Right(计算),Bottom(计算)。
2 当鼠标移动时,判断:
Accept1:=(Top2〈Botton1)or(Botton2〉Top1);
Accept2:=(Left2〉Right1)or(Right2〈Left1);
if Accept1 and Accept2 then 不重叠.