PB DataWindw的字段自动换行的同时且自动高度的方法
将数据窗口中相应列的auto horz scroll 为不选中,将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 { = 'width' }") //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_replaced<>as_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