在自定义数据窗口中创建TEXT控件

lidongxp 2009-06-19 12:39:36
在自定义数据窗口中创建TEXT控件,为什么在窗口中不显示呢?
自定义数据窗口中定义了个函数,如下
string ss
ss='create text(band=header alignment="0" text="AAAAA" border="0" color="16711680" x="100" y="100" height="80" width="80" name="t_1" visible="1" font.face="Webdings" font.height="-12" font.weight="400" font.family="1" font.pitch="2" font.charset="2" background.mode="1" background.color="553642121")'
modify (ss);
insertrow(1);
return '';
...全文
43 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
永生天地 2009-06-19
  • 打赏
  • 举报
回复
1、要判断创建语法是否正确

string ls_errtxt
ls_errtxt = modify (ss); //如果语法错误ls_errtxt会显示出错的行和列,没有错误为空字符串

messagebox显示结果:Line 1 Column 133:incorrect syntax

2、找错误出在name="t_1",不能加引号

3、band=header y="100" 如果header小于100也看不到

[Quote=引用楼主 lidongxp 的帖子:]
在自定义数据窗口中创建TEXT控件,为什么在窗口中不显示呢?
自定义数据窗口中定义了个函数,如下
string ss
ss='create text(band=header alignment="0" text="AAAAA" border="0" color="16711680" x="100" y="100" height="80" width="80" name="t_1" visible="1" font.face="Webdings" font.height="-12" font.weight="400" font.family="1" font.pitch="2" font.charset="2" background.mode="1" background.colo…
[/Quote]
newease 2009-06-19
  • 打赏
  • 举报
回复



如果要考虑整体效果,还要重设Header高度或调整各字段标题位置
newease 2009-06-19
  • 打赏
  • 举报
回复
下面代码可以在数据窗口动态添加文本

string ls_modistr
long ll_handerheight
ls_modistr= ' create text(band=foreground alignment="2" text="添加文本" border="0" color="255" x="91" y="76" height="128" width="1458" html.valueishtml="0" name=t_1 visible="1" font.face="幼圆" font.height="-22" font.weight="700" font.family="1" font.pitch="1" font.charset="134" background.mode="1" background.color="553648127" )'
dw_1.modify(ls_modistr)

604

社区成员

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

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