oSourceObj = aSourceObj[1]
cRowName=osourceobjCAPTION
cgrid='thisformgrid1' &&&&表格的名字ogrid=&cgrid
cfilename=ogridRECORDSOURCEIF EMPTY(cfilename) OR SELECT(cfilename)=0
RETURN
ENDIFogridRECORDSOURCE=''
SELECT FROM (cfilename) INTO CURSOR (cfilename+'_tmp')
USE IN (cfilename)SELECT FROM (cfilename+'_tmp') ORDER BY &crowname INTO DBF (cfilename)
USE IN (cfilename+'_tmp')ogridRECORDSOURCE=cfilename
SELECT(cfilename)
GOTO TOP
ogridSETFOCUS
然后在表格的refresh(刷新方法)里写入如下代码:cgrid='thisform'+ALLTRIM(thisname)
ogrid=&cgridFOR gnCount = 1 TO thiscolumncount && header代理
cheader='thiscolumn'+alltrim(str(gncount))+'header1'
oheader=&cheader
oheadertooltiptext='单击按本列值重新排序表格数据'
BINDEVENT(oheader,"Click",thisform,"headerclick")
NEXT
当表格装载数据后,刷新表格(运行方法thisformgrid1refresh),即可将表格中header的click事件设置为自定义方法的代理。当单击表格header时,即运行headerclick自定义方法,将表格数据源表重新排格使用计时器控件, 设置interval属性为间隔, 不要太小哦, 单位是毫秒
在timer事件中:
if !empty(thisformcaption)
thisformcaption=''
else
thisformcaption='我的表单'
endif
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)