| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1617 人关注过本帖
标题:vfp 想要实现两个表格控件同时翻页
只看楼主 加入收藏
NanT
Rank: 1
等 级:新手上路
帖 子:18
专家分:0
注 册:2018-6-1
结帖率:75%
收藏
已结贴  问题点数:20 回复次数:4 
vfp 想要实现两个表格控件同时翻页
运行结果:
图片附件: 游客没有浏览图片的权限,请 登录注册

挂起:
图片附件: 游客没有浏览图片的权限,请 登录注册

上一页代码:
if pno = 1
messagebox("first")
else
select(select(1))
thisform.lockscreen = .t.
close databases
select adminl
select adminl.number,joint,name,nationality from adminl where mod(recno(),2)=1 into cursor ji   &&临时表ji
select adminl.number,joint,name,nationality from adminl where mod(recno(),2)=0 into cursor ou   &&临时表ou
select ji
rc = reccount()    &&总记录
pc = iif(rc/10-int(rc/10)>0,int(rc/10)+1,int(rc/10))   &&总页数
pno = pno - 1    &&当前为第几页-1(上一页)
rno = pno*10 - 9     &&当前页第一条记录为第几条记录-9(上一页第一条记录为第几条记录)
if file("jitemp")
if used("jitemp")
select jitemp
use
endif
delete file ji.temp
endif
goto(rno)
copy to jitemp next 10
select (select(1))
use jitemp
thisform.pageframe1.page5.grid1.recordsourcetype = 1
thisform.pageframe1.page5.grid1.recordsource = "jitemp"

select ou
rc = reccount()    &&总记录
pc = iif(rc/10-int(rc/10)>0,int(rc/10)+1,int(rc/10))   &&总页数
pno = pno - 1    &&当前为第几页-1(上一页)
rno = pno*10 - 9     &&当前页第一条记录为第几条记录-9(上一页第一条记录为第几条记录)
if file("outemp")
if used("outemp")
select outemp
use
endif
delete file ou.temp
endif
goto(rno)
copy to outemp next 10
select (select(1))
use outemp
thisform.pageframe1.page5.grid2.recordsourcetype = 1
thisform.pageframe1.page5.grid2.recordsource = "outemp"
thisform.lockscreen = .f.
endif

下一页代码:
if pno = pc  &&if 当前页数等于总页数(最后一页)
messagebox("last")
else
thisform.lockscreen = .t.
close databases
select (select(1))
select adminl   &&查询adminl表
select adminl.number,joint,name,nationality from adminl where mod(recno(),2)=1 into cursor ji   &&临时表ji
select adminl.number,joint,name,nationality from adminl where mod(recno(),2)=0 into cursor ou   &&临时表ou
select ji
rc = reccount()
pc = iif(rc/10-int(rc/10)>0,int(rc/10)+1,int(rc/10))
pno = pno + 1
rno = pno*10-9
if file("jitemp")
if used("jitemp")
select jitemp
use
endif
delete file ji.temp
endif
goto(rno)
if rc-rno<10
copy to jitemp next (rc-rno+1)
else
copy to jitemp next 10
endif
select(select(1))
use jitemp
thisform.pageframe1.page5.grid1.recordsourcetype = 1
thisform.pageframe1.page5.grid1.recordsource = "jitemp"

select ou
rc = reccount()
pc = iif(rc/10-int(rc/10)>0,int(rc/10)+1,int(rc/10))
pno = pno+1
rno = pno*10-9
if file("outemp")
if used("outemp")
select outemp
use
endif
delete file ou.temp
endif
goto(rno)
if rc-rno<10
copy to outemp next (rc-rno+1)
else
copy to outemp next 10
endif
select(select(1))
use outemp
thisform.pageframe1.page5.grid2.recordsourcetype = 1
thisform.pageframe1.page5.grid2.recordsource = "outemp"
thisform.lockscreen = .f.
endif

请问出现了什么错误??求大佬教
搜索更多相关主题的帖子: if select thisform 记录 file 
2018-06-06 15:47
gs2536785678
Rank: 10Rank: 10Rank: 10
等 级:贵宾
威 望:45
帖 子:601
专家分:1770
注 册:2017-7-16
收藏
得分:10 
看过,很对不起,刚才 我已经讲过了,与你对
VFP的理解不同,我从来不用[临时表]
所以这次不能帮助你了。
2018-06-06 17:06
NanT
Rank: 1
等 级:新手上路
帖 子:18
专家分:0
注 册:2018-6-1
收藏
得分:0 
回复 2楼 gs2536785678
如果是你 想要实现表格分栏并分页  你会怎么实现呢?
2018-06-06 17:16
星光悠蓝
Rank: 9Rank: 9Rank: 9
来 自:山水甲天下
等 级:贵宾
威 望:52
帖 子:508
专家分:1248
注 册:2010-1-11
收藏
得分:10 
为什么要分栏分页,可以为表格每一列指定数据源来选择显示!
2018-06-06 21:14
NanT
Rank: 1
等 级:新手上路
帖 子:18
专家分:0
注 册:2018-6-1
收藏
得分:0 
回复 4楼 星光悠蓝
1、实现分栏分页是想要一次看多条信息。
2、表格每一列指定数据源来选择显示?是什么意思呢?
2018-06-07 11:43
快速回复:vfp 想要实现两个表格控件同时翻页
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.016247 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved