关于动态数据窗口的问题-------创建的文本控件宽度怎么改变不了????(在线等)
我用下面的语句生成了一个数据窗口,
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) + ")")