在VB6的数据环境报表DataReprot中,如何使LABEL的caption值动态改变

xu 2000-03-06 11:45:00
在VB6的数据环境报表DataReprot中,可以增加Label控件,就象在FORM中一样,但是Data
Report的代码中不象from中可以引用:me.label1.caption="tip".如果要动态改变label1值,在DataReprot中如何做?
...全文
182 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
yepo 2000-03-13
  • 打赏
  • 举报
回复
直接使用全局变量
DataReport1.Section(1).Controls("Label1").Caption=变量名
Claud 2000-03-10
  • 打赏
  • 举报
回复
DataReport1.Section(1).Controls("Label1").Caption=Form1.Text
其中 Section(i) 中的 i 由 DataReport1 里的 Section 自上而下的位置
决定的,而不一定等于 Report Header (Section4) 中的 4
Chen_Lin 2000-03-06
  • 打赏
  • 举报
回复
Dim sect, ctl
For Each sect In DataReport1.Sections
For Each ctl In sect.Controls
select case ctl.Name
case "..."

end select
MsgBox ctl.Caption
Next ctl
Next sect
dongdong 2000-03-06
  • 打赏
  • 举报
回复
不错,但controls()中的1最好写成控件的名称,这样就不必去找你的LABEL是第几个控件了,如下:

DataReport1.Sections(3).Controls("LABEL1").CAPTION="GOOD LUCK"
Un1 2000-03-06
  • 打赏
  • 举报
回复
Sections(1).Controls(1).Caption = "tip"

809

社区成员

发帖
与我相关
我的任务
社区描述
VB 多媒体
社区管理员
  • 多媒体
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧