PB数据窗口绝对技巧_第1页
PB数据窗口绝对技巧_第2页
PB数据窗口绝对技巧_第3页
PB数据窗口绝对技巧_第4页
PB数据窗口绝对技巧_第5页
已阅读5页,还剩3页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

PB 数据窗口绝对技巧数据窗口绝对技巧 1 如何让存储文件目录的列 显示图片 如何让存储文件目录的列 显示图片 选择对应的 column 的 display as picture 属性为 true 2 如何复制 如何复制 grid 类型的所选择的行的数据到系统剪切板 类型的所选择的行的数据到系统剪切板 string ls selected ls selected dw 1 Object DataWindow Selected Data clipbord ls selected 3 如何改变 如何改变 GRID 数据窗口列位置 新手常见 数据窗口列位置 新手常见 先 preview 然后在预览窗口拖动位置即可 4 如何设置 如何设置 DW 的底色 的底色 在 DW 的 editsource 中改变 color 的值 5 如何将 如何将 Grid 风格改成自由格式 风格改成自由格式 在 DW 的 editsource 中将 processing 1的1改为0 6 要新建一个表 要新建一个表 A 但风格和现有表但风格和现有表 B 风格一样 怎么将风格一样 怎么将 A 表快速设置成表表快速设置成表 B 风格 风格 复制 B 表 C 在 C 表的 DW 中的 editsource 中将表名和字段名改成 A 表的 即可 7 如何实现 如何实现 gird 风格的风格的 datawindow 的多栏表头 的多栏表头 添加 text 到 header 带区 并设置 band 属性为 foreground 保存 edit source 修改 te xt 的 x 和 width 属性表达式如下 x 100 t integer describe firstcol x width 100 tinteger describe lastcol x in teger describe firstcol x integer describe lastcol width 8 如何过滤 如何过滤 dddw 编辑风格的显示值为指定值的记录 编辑风格的显示值为指定值的记录 dw 1 setfilter lookupdisplay column name ls display value your dw 1 filter 9 如何设置 如何设置 datawindow 的某一列为空 的某一列为空 string ls temp setnull ls temp dw 1 object columnname primary current ls temp 10 如何设置 如何设置 datawindow 的单双行不同颜色间隔 的单双行不同颜色间隔 在 detail 带区的 color 属性表达式中写上 if mod getrow 2 1 rgb 255 0 0 rgb 0 2 55 0 如果是当前行以第三种颜色表示 表达式如下 if getrow current rgb 255 0 0 i f mod getrow 2 1 rgb 0 0 255 rgb 0 255 0 11 如何获取指定名称的 如何获取指定名称的 datawindowobject DWObject ldwo use ldwo abc ldwo use dw 1 Object ldwo abc ldwo use get attribute t 1 FALSE t 1为 datawindow 中 text 对象的名称 12 如何缩放 如何缩放 datawindow 的打印大小 的打印大小 dw 1 object datawindow zoom 150 or dw 1 object datawindow zoom 75 13 如何在已过滤后的数据基础上对 如何在已过滤后的数据基础上对 datawindow 进行过滤 进行过滤 dw 1 setfilter dw 1 describe datawindow table filter your join your new filter dw 1 filter 14 如何在 如何在 datawindow 中显示动态时间 中显示动态时间 建立一个计算域 表达式为 string datetime today now yyyy 年 mm 月 dd 日 hh 点 mm 分 ss 秒 同时设置 datawindow 的属性 dw 1 Object DataWindow Timer Interval 500 15 如何让带用 如何让带用 title bar 的的 datawindow 控件的标题栏呈活动窗口的颜色 控件的标题栏呈活动窗口的颜色 外部函数定义 funcation logn SetActiveWindow long hwnd Library user32 dll datawindow 控件的 clicked 事件代码 setactivewindow handle this 16 如何设置 如何设置 datawindow 的当前行指示图标 的当前行指示图标 在 datawindow 中建立一个计算列 expression 为 并将该计算列移动为 datawindo w 的第一个列 在 datawindow 控件的 rowfocuschanged 事件中写入代码 SetRowFocusIndicator hand 或 setrowfucsindicator p 1 p 1为窗口上的 picture 控 件名 17 如何通过代码打开 如何通过代码打开 dddw 定义外部函数引用声明 SUBROUTINE keybd event int bVk int bScan int dwFlags int dwExtraInf o LIBRARY user32 dll 代码如下 constant integer VK F4 115 dw 1 SetFocus dw 1 SetColumn dept head id 设置当前 dddw keybd event VK F4 0 0 0 按下 F4键 keybd event VK F4 0 2 0 释放 F4键 18 如何打印 如何打印 datawindow 的内容到文件中 的内容到文件中 dw 1 object datawindow print fileName c temp prn dw 1 print 19 如何设置 如何设置 dddw 的初始值 的初始值 dw 1 object columnname Initial your initial value 20 如何只显示不同的数据 如何只显示不同的数据 dw 1 filter isnull columnname 1 and columnnamecolumnname 1 dw 1 filter 21 如何让带有 如何让带有 title bar 的的 datawindow 不可以移动 不可以移动 在 datawindow 的自定义事件 ue nchittest pbm nchittest 中写入如下代码 return 1 22 如何在 如何在 N UP 显示风格中建立基于第显示风格中建立基于第 N 栏中的列的计算列 栏中的列的计算列 如 column 有两列 number 和 price 并显示为两栏 则第一栏的 cost 计算列的 exp ression 为 number price 第二栏的 cost 1计算列的 expression 为 number 1 price 1 23 如何清空 如何清空 ddlb 或或 edit codetable 中项目 中项目 dw 1 Object columnname Values 24 如何实现指定的 如何实现指定的 column 的字体旋转的字体旋转90度 度 dw 1 object columnname font Escapement 900 25 如何获取 如何获取 datawindow 的的 sql 代码 代码 可以通过以下四种方法获取 sql 代码 string szselect szselect dw 1 describe datawindow table select szselect dw 1 describe datawindow table sqlselect szselect dw 1 describe datawindow table select attribute szselect dw 1 getsqlselect 26 如何获取 如何获取 datawindow 对象占有的虚拟存储的容量 对象占有的虚拟存储的容量 使用 datawindow storage 属性 举例 在 datawindow 控件的 retrieverow 事件中 写入如下代码 long lstorage lstorage long dw 1 object datawindow storage if lstorage 50000 then dbcancel 27 如何连续在同一张纸打印两个数据窗口 如何连续在同一张纸打印两个数据窗口 dw 1 object datawindow print filename temp prn dw 2 object datawindow print filename temp prn dw 1 print dw 2 print 28 如何设置 如何设置 datawindow 分组后每个分组中的记录号 分组后每个分组中的记录号 建立一个计算列 expression 为 getrow first getrow for group 1 1 29 如何实现在 如何实现在 datawindow 中只有新增的行 才可以编辑 中只有新增的行 才可以编辑 在所有的 column 的 protect 属性表达式中写入以下表达式 if isrownew 0 1 30 除了循环以外 有没有更好的方法统计数据窗口中处于选中状态的行数 除了循环以外 有没有更好的方法统计数据窗口中处于选中状态的行数 一般习惯于使用循环来统计数据窗口中处于选中状态的行数 有没有更好的方法 其 实此问题在应用上用处不大 讨论一下 活跃一下思维还是有好处的 方法一 long ll Selected ll Selected long dw 1 describe evaluate sum if IsSelected 1 0 for all 1 方法二 long ll Selected ll Selected long dw 1 describe evaluate count IsSelected for all 1 方法三 upperbound dw 1 Object Data Selected 31 怎么让 怎么让 PB 只打印当前记录 是用只打印当前记录 是用 Free 格式制作的数据窗口 格式制作的数据窗口 DataStore ldt temp long ll Row ll Rows ll Rows dw XX Rowcount If ll Rows 0 Then GoTo the end If ll Rows 1 Then dw XX Print GoTo the end End if dw XX SetRedraw False ldt temp Create DataStore ldt temp DataObject dw XX DataObject ll Row dw XX GetRow dw XX RowsMove 1 ll Rows Primary ldt temp 1 Primary ldt temp RowsMove ll Row ll Row Primary dw XX 1 Primary dw XX Print dw XX RowsMove 1 1 Primary ldt temp ll Row Primary ldt temp RowsMove 1 ll Rows Primary dw XX 1 Primary Destroy ldt temp dw XX SetRedraw True the end 只用将上述脚本拷入到打印部分即可 dw XX 为被打印的 free 型数据窗口 该方法 可保证 dw XX 中的数据在打印前后包括 sort 等属性均不发生任何改变 但效率较低 不 宜用在数据量太大的数据窗口中 当然 考虑到打印本身速度就比较慢 所以3000行数据 是可以采用这种方法并让用户接受的 若在同一窗口上存在与 dw XX 共享的 grid 数据窗 口并且与 dw XX 同时显示 则需要与 dw one 一起 SetRedraw 32 字段如何自动换行的同时且自动高度 字段如何自动换行的同时且自动高度 将数据窗口中相应列的 auto horz scroll 为不选中 选中 autosize height 将 detail 的 autosize height 选中 在数据窗口 retrieve 后调用下面函数即可 uf set text datawindow adw content string as columns boolean ab ignoreblank Describe 在数据窗口 adw content 中 在 as columns 中包含的列中插入空格 Args as columns 要操作的多个列 列间用逗号隔开 if not isvalid adw content or isnull as columns or len as columns 1 or isnull ab ignoreblank then return 1 n cst string lnv string string ls column ls width as source as replaced ls temp int li upperbound li width li column li fontWidth li counter long ll rowcount ll row ll totalstep int li yield lnv string of parsetoarray as columns ls column li upperbound upperbound ls column ll rowcount adw content rowcount if li upperbound 1 or ll rowcount 1 then return 1 openwithparm w waiting this ib cancel false iw frame enabled false ll totalstep ll rowcount li upperbound w waiting uf register ll totalstep for li column 1 to li upperbound ls width adw content describe ls column li column width li width integer ls width if ls width or ls width or li width 0 then continue end if ls temp adw content describe ls column li column Font property w idth messagebox ls column li column Font property width ls temp return 1 li fontwidth 27 li counter li width li fontWidth for ll row 1 to ll rowcount if ib cancel then iw frame enabled true return 0 pressed cancel button end if as source adw content getitemstring ll row ls column li column as replaced uf insertstring as source li counter false if as replacedas source then adw content setitem ll row ls column li column as replaced end if w waiting uf stepit next next close w waiting iw frame enabled true return 1 33 如何使 如何使 dw 的列不可移动 不可调整列宽 的列不可移动 不可调整列宽 在 datawindow 的 cilcked 事件写 if row 0 then return 1 end if 34 光标跳转到数据窗口的某一行某一列 光标跳转到数据窗口的某一行某一列 dw 1 scrolltorow ll row dw 1 setcolumn ll column 35 如何使光标指向每页第一行 如何使光标指向每页第一行 long ll firstrowonpage long dw 1 describe datawindow firstrowonpage dw 1 scrolltorow ll firstrowonpage dw 1 setrow ll firstrowonpage 36 Grid 的窗口如何使第一列固定不动 的窗口如何使第一列固定不动 选上 data OBJECT 的 HSplitScroll 属性 在 constructor 事件中 dw 1 Object DataWindow HorizontalScrollSplit integer dw 1 describe 1 width 第一列的宽度 在 scrollhorizontal 事件中 int i if pane 1 then i integer this OBJECT datawindow horizontalscrollposition2 if i 0 then this OBJECT datawindow horizontalScrollPosition 0 end if else i integer this Object D

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论