Excel中通过标题自动筛选很方便,其实pb中也可以实现,减少了程序中筛选输入中的繁琐,简单实现代码如下。
Int ll_count , ll_col ,ll_nextcol , ll_x , ll_width , ll_newx , ll_height
String ll_visible , ll_colname , ls_return
ll_height = Integer(This.Describe("DataWindow.Header.Height")) -16
ll_count = Integer(This.Describe("DataWindow.column.count"))
For ll_col = 1 To ll_count
ll_visible = This.Describe("#"+String(ll_col)+".Visible")
ll_x = Integer(This.Describe("#"+String(ll_col)+".x"))
ll_width = Integer(This.Describe("#"+String(ll_col)+".width"))
ll_colname = This.Describe("#"+String(ll_col)+".name")
If ll_visible <> '0' Then
ll_newx = ll_x + ll_width - 50
ls_return = This.Modify( &
"create text(band=header alignment='0' text='6'