专注收集记录技术开发学习笔记、技术难点、解决方案
网站信息搜索 >> 请输入关键词:
您当前的位置: 首页 > PB

关于pb里怎么实现透明文字

发布时间:2011-06-29 20:33:25 文章来源:www.iduyao.cn 采编人员:星星草
关于pb里如何实现透明文字
我在网上找了段代码,单个标签是可以,多个就不行了,是咋回事啊?
在窗口实现的话

constructor里写代码
this.backcolor=2^29

自定义事件ue_paint消息为pbm_paint,代码为
if IsValid(This) then
  if ib_paint then Return 0
  ib_paint = True
  Visible = False
  Do While Yield()
  Loop
  Visible = True
  ib_paint = False
end if
Return 0

ib_paint为实例变量

------解决方案--------------------
这是一个透明背景的静态文本对象。可以继承它并放置在窗口某处,以使文本的背景为透明。并非你说的文字透明!
------解决方案--------------------
将以下内容复制保存到本地文件“o_statictext.sru”中,然后导入到pbl里
C/C++ code
$PBExportHeader$uo_statictext.sru
forward
global type uo_statictext from statictext
end type
end forward

global type uo_statictext from statictext
integer width = 457
integer height = 72
integer textsize = -12
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
long textcolor = 33554432
long backcolor = 67108864
string text = "none"
boolean focusrectangle = false
event ue_parint pbm_paint
end type
global uo_statictext uo_statictext

type variables
boolean ib_paint
end variables
event ue_parint;if IsValid(This) then
    if ib_paint then Return 0
    ib_paint = True
    Visible = False
    Do While Yield()
    Loop
    Visible = True
    ib_paint = False
end if
Return 0
end event

event constructor;this.backcolor=2^29
end event

on uo_statictext.create
end on

on uo_statictext.destroy
end on

------解决方案--------------------
主要是 ib_paint 变量因为多个控件在ue_paint事件中,反复进行值修改,相互影响了
友情提示:
信息收集于互联网,如果您发现错误或造成侵权,请及时通知本站更正或删除,具体联系方式见页面底部联系我们,谢谢。

其他相似内容:

热门推荐: