关于静态文本问题

sjysh 2000-12-23 08:15:00
在PB中有使静态文本变透明的方法吗?
谢谢!
...全文
146 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
michaelzhang 2000-12-26
  • 打赏
  • 举报
回复
我用如下方法实现,但如果显示的字被覆盖后就看不见了,所以我只能将她写在TIMER中,
不知有没有更好的方法。
Function ulong GetDC (ulong hWnd) Library "USER32.DLL"
Function long ReleaseDC( long hWnd, long hDC ) Library "user32"
Function boolean TextOut (ulong hdcr, integer stx, integer sty, ref string lpString, long nCount) Library "GDI32.DLL" Alias for "TextOutA"
Function int SetBkMode (ulong hdcr, integer mode) Library "GDI32.DLL"
Function ulong SetTextColor (ulong hDC, ulong crColor) Library "GDI32.DLL"


ulong iul_hdc

iul_hdc = getdc(handle( dw_1 ))
string ls_msg
ls_msg = "This is an example."
SetBkMode (iul_hdc, 1) //设定字符输出背景透明
SetTextColor (iul_hdc, RGB( 255,255,255 ))
TextOut (iul_hdc, 30, 30, ls_msg, len( ls_msg ))
ReleaseDC( handle( p_1 ), iul_hDC )
viv_wangsc 2000-12-23
  • 打赏
  • 举报
回复
呵呵,pb中直接不能够,但是可以取得静态文本的窗体句柄后然后使用WINAPI函数来设置背景颜色才能够做到;
具体的函数可以查WINAPI的窗口部分;

1,078

社区成员

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

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