急!!vfp设计一个表单,在窗体上放置一个标签控件,当单击表单时,标签控件中的文本内容显示若干中文

2025-06-23 06:45:20
推荐回答(1个)
回答1:

在表单上添加1个容器控件Container1
右键点击Container1,在弹出的菜单中选“编辑”
在Container1中添加标签控件label1

在表单中添加微调控件,假设其名为spinner1,将其value值设置为1(秒)

在表单上添加计时器控件timer1
将timer1的interval值设置为500(也就是0.5秒,可根据需要设置)
将timer1的Enabled属性值设置为.F.
其timer代码如下:
thisform.Container1.label1.left=thisform.Container1.label1.left-1
if thisform.Container1.label1.left<1
thisform.Container1.label1.left=thisform.Container1.width
endif
this.interval=thisform.spinner1.value*1000

在表单上天加两个命令按钮
其中command1的Caption属性设置为“开始”
其click代码如下:
thisform.timer1.enabled=.T.

其中command2的Caption属性设置为“关闭”
其click代码如下:
thisform.timer1.enabled=.F.