vfp中如何用时钟控件实现标签的移动?

如题所述

在时钟控件的timer事件中输入以下代码
**向左走
thisform.label1.left=thisform.label1.left-10
if thisform.label1.left+thisform.label1.width<0
thisform.label1.left=thisform.width
endif

**向右走
thisform.label2.left=thisform.label2.left+10
if thisform.label2.left>thisform.width
thisform.label2.left=-thisform.label2.width
endif
**向上走
thisform.label3.top=thisform.label3.top-10
if thisform.label3.top+thisform.label3.height<0
thisform.label3.top=thisform.height
endif
**向下走
thisform.label4.top=thisform.label4.top+10
if thisform.label4.top>thisform.height
thisform.label4.top=thisform.label4.height
endif
温馨提示:答案为网友推荐,仅供参考
相似回答