当前位置: 代码迷 >> PB >> 关于pb里怎么实现透明文字
  详细解决方案

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

热度:507   发布时间:2016-04-29 10:42:07.0
关于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.sruforwardglobal type uo_statictext from statictextend typeend forwardglobal type uo_statictext from statictextinteger width = 457integer height = 72integer textsize = -12integer weight = 400fontcharset fontcharset = ansi!fontpitch fontpitch = variable!fontfamily fontfamily = swiss!string facename = "Arial"long textcolor = 33554432long backcolor = 67108864string text = "none"boolean focusrectangle = falseevent ue_parint pbm_paintend typeglobal uo_statictext uo_statictexttype variablesboolean ib_paintend variablesevent 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 = Falseend ifReturn 0end eventevent constructor;this.backcolor=2^29end eventon uo_statictext.createend onon uo_statictext.destroyend on
------解决方案--------------------
主要是 ib_paint 变量因为多个控件在ue_paint事件中,反复进行值修改,相互影响了
  相关解决方案