关于动态数据窗口的问题-------创建的文本控件宽度怎么改变不了????(在线等)

let5flying 2003-09-07 08:50:14

我用下面的语句生成了一个数据窗口,

string ls_sql,ls_Style,ls_syntax,ls_error
ls_sql = "select * from data5"
ls_Style = "Style(type=grid) Text(font.face='arial')"
ls_syntax = sqlca.SyntaxFromSQL(ls_sql,ls_Style,ls_error)
if len(ls_error) >0 then
messagebox('Error','SyntaxFromSQL Error:~r'+ls_error)
else
//---------------------------- 创建语法,错误信息
dw_test.create(ls_syntax,ls_error)
if len(ls_error) >0 then
MessageBox("Error", "Create have these errors: ~r" + ls_error)
else
dw_test.settransobject(sqlca)
dw_test.retrieve()
end if
end if

现在需要在数据窗口控件中加一个标题,“查询数据”
现在已经能加上了,可是文本宽度无法调整,字体也不好用,,pb高人指点啊,,,代码如下:

int temp,len,l_pos,l_start
string object_list // DWO对象列表,以TAB键分开
string l_object

len = integer(dw_test.describe("datawindow.detail.height"))
temp = integer((dw_test.describe("datawindow.header.height")))

object_list = dw_test.describe("datawindow.objects")

int l_dw_key_height = 300


do
l_object = "header"
l_start = l_pos
l_pos = pos(object_list, "~t", l_start + 1)
if l_pos = 0 then l_pos = 9999
l_object = mid(object_list, l_start + 1, l_pos - l_start - 1)
if dw_test.describe(l_object + ".band") = "header" then

loop until l_pos = 9999

dw_test.modify("datawindow.header.height=" +string(400))

//-----------名字的标志
int l_new_field =0

//---------颜色
//string l_bg_color = "1086374080", l_color = "33554432"
string l_bg_color = "1008637400", l_color = "7400"

//--------------文字的位置、宽度、高度
string l_height= string(100), l_x = string(0), l_y = string(0), l_width = string(1500)

//----------------字体
string l_fontface = "华文行楷"
string l_fontheight = string(60)

//-----------属性字符串
string l_attr_list

l_attr_list = " band = header " + &
" color = '" + l_color + "'" + &
" background.color = '" + l_bg_color + "'" + &
" Background.Mode = '0'" + &
" font.face = '" + l_fontface + "'" + &
" font.height = '" + l_fontheight + "'" + &
" height = '" + l_height + "'" + &
" text = '数据查询'" + &
" width = '" + l_width + "'" + &
" x = '" + l_x + "'" + &
" y = '" + l_y + "'"

dw_test.modify("create text (" + &
l_attr_list + " name = hdr" + string(l_new_field) + ")")


...全文
33 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
klbt 2003-09-08
  • 打赏
  • 举报
回复
祝贺楼主,自力更生,奋发图强!
liujiaqiang 2003-09-07
  • 打赏
  • 举报
回复
恭喜恭喜,下次再问我们PB的兄弟们,我们一定会帮助你的.

jdsnhan 2003-09-07
  • 打赏
  • 举报
回复
恭喜楼主,自力更生,我蹭分 *^v^*
let5flying 2003-09-07
  • 打赏
  • 举报
回复
是band = header 的问题
应改为
band = foreground
let5flying 2003-09-07
  • 打赏
  • 举报
回复
不好意思
问题已经解决

609

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder DataWindow
社区管理员
  • DataWindow社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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