CSDN高手看过来:并非有意提问,只因问题不会。

qqf 2003-11-11 11:13:20
1、当字段为自动适应高度的话,如何取得它实际的高度。
(注):当列自动适应高度时,无法取出正确的高度


2、如何取得列的VISIBLE属性(用表达式控制的)
(注):我用dw_1.Describe("Evaluate('If(cc='1', 0, 1 )', "+string(1)+")")
也无法取出正确的表达式的值

求解。

...全文
32 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
qqf 2003-11-13
  • 打赏
  • 举报
回复
白兔,第一个问题呢?
你老大可以招?
klbt 2003-11-12
  • 打赏
  • 举报
回复
PB中的波浪号很容易弄糊涂。
tommyhuanglei 2003-11-12
  • 打赏
  • 举报
回复
up收藏!
xyzliuin 2003-11-12
  • 打赏
  • 举报
回复
关注
学习
qqf 2003-11-11
  • 打赏
  • 举报
回复
你给我的上面一大段代码,我看了半天也没看出哪里是取出列高的?
qqf 2003-11-11
  • 打赏
  • 举报
回复
lmby(鹿门布衣) ,有一个问题,你的是取出行高,可不是取出列的高度呀。自动适应高度还是没取出呀。
qqf 2003-11-11
  • 打赏
  • 举报
回复
谢谢,二已经搞定。
string ls_ret
ls_ret = dw_1.Describe("Evaluate('If(bb=~~~'bb1~~', 1, 0 )', "+string(1)+")")
messagebox('',ls_ret)
lmby 2003-11-11
  • 打赏
  • 举报
回复
1有个简单办法:dw_name.describe( "evaluate('rowheight()'," + string( ll_row ) + ")" )

2看语法应该是对的。不过你测试不对就不对咯。
qqf 2003-11-11
  • 打赏
  • 举报
回复
楼上的高人,我对2进行了测试,假如测试的对的显数值形才可以正确的取出VISIBLE的,而是字符的就不行。
如:
string ls_visible
ls_visible=dw_1.Object.bb.Visible
ls_visible = Right(ls_visible,Len(ls_visible) - Pos(ls_visible, "~t"))
ls_visible = left(ls_visible,len(ls_visible) - 1)
messagebox("",ls_visible)
ls_visible = dw_1.Describe("Evaluate('" + ls_visible + "'," + String(1) + ")")
messagebox("",ls_visible)
lmby 2003-11-11
  • 打赏
  • 举报
回复
1. long ll_dwloop //the datawindow of circle var
long ll_loop
long ll_cloop //need change y pos of column and text
long ll_columnheight //columnheight
long ll_textheight //textheight
long ll_difheight //need change y pos
long ll_columncount //column count
long ll_detailheight //detail band height
long ll_modiloop
string ls_height //set relative column of height
string ls_columntext //set y pos of clolumn of text
string ls_columnname //set y pos of clolumn of name
string ls_return
string ls_editmask //editmask
string ls_coltype
string ls_tmpname //conv columnname
string ls_modistr //modify of string
any la_value //set all type of value to the var
dec{4} lf_convalue //conv decimal value
string ls_convalue //conv string value
boolean lb_noscroll=false //no use set vscroll
boolean lb_error=false
boolean lb_modi = false
is_modichangecolor = string(RGB(il_modichangered,il_modichangegreen,il_modichangeblue)) //modify background color string

ll_textheight=long(is_textheight)
for ll_dwloop= il_oritabcount + 1 to upperbound(idw_dw[])
idw_dw[ll_dwloop].setredraw(false)
ll_difheight=0 //repeate set value
ll_columnheight=0 //repeate set value
ll_detailheight=0 //repeate set value
ll_columncount=long(idw_dw[ll_dwloop].Describe('DataWindow.Column.Count')) //get the current template column count
for ll_loop=1 to ll_columncount
lb_noscroll = false
ls_columnname=idw_dw[ll_dwloop].describe('#'+string(ll_loop)+'.Name') //get column name
ls_coltype=idw_dw[ll_dwloop].describe('#'+string(ll_loop)+'.coltype') //get column type
ls_columntext=ls_columnname+'_t'
la_value = idw_dw[ll_dwloop].object.data[1,ll_loop] //get value
//-------------------------------------------------------------------------------------------------------------
lb_modi = false //repeate set value
//set already modify backcolor
for ll_modiloop = 1 to upperbound(is_modichangefield)
if upper(trim(ls_columnname)) = is_modichangefield[ll_modiloop] then
lb_modi = true
exit
end if
next
if lb_modi = true then
ls_modistr = "#"+string(ll_loop)+".background.color='"+is_modichangecolor+"'"
ls_return = idw_dw[ll_dwloop].modify(ls_modistr)
if len(ls_return) > 0 then
lb_error=true
exit
end if
end if
//-------------------------------------------------------------------------------------------------------------
//get the current column should was setted column height
ll_columnheight=(ceiling(len(trim(string(la_value)))/long(is_Columncharactercount)))*long(is_columnheight)
if isnull(ll_columnheight) or ll_columnheight=0 or ll_columnheight <= long(is_columnheight) then
ll_columnheight=long(is_columnheight)
lb_noscroll = true
end if
//get the below column and text should move y pos of count.
ll_difheight=ll_difheight+ll_columnheight -long(is_columnheight)
ls_return=idw_dw[ll_dwloop].modify(ls_columnname + ".height ='" + &
string(ll_columnheight)+"'") //set column of height
if len(ls_return) > 0 then
lb_error=true
exit
end if
//if the column of value is too much set the column set vscroll bar
if lb_noscroll = true then
ls_return=idw_dw[ll_dwloop].modify(ls_columnname + ".Edit.VScrollBar =no") //set column of height
if len(ls_return) > 0 then
lb_error=true
exit
end if
elseif lb_noscroll = false then
ls_return=idw_dw[ll_dwloop].modify(ls_columnname + ".Edit.VScrollBar =yes") //set column of height
if len(ls_return) > 0 then
lb_error=true
exit
end if
end if


2.是对的。
qqf 2003-11-11
  • 打赏
  • 举报
回复
楼上可能没看清我的问题,或许没有试过,你的那种办法,都会只返回“1 表达式”
gf_iLoveU 2003-11-11
  • 打赏
  • 举报
回复
1 等待学习。

2 <DW Control Name>.Object.<Columnname>.Visible

1,056

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder 相关问题讨论
社区管理员
  • 基础类社区
  • WorldMobile
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧