我在网上找了段代码,单个标签是可以,多个就不行了,是咋回事啊?
在窗口实现的话
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事件中,反复进行值修改,相互影响了