当前位置: 代码迷 >> PB >> 透明的statictext 在PB11.5 不能触发 单击事件,该怎么解决
  详细解决方案

透明的statictext 在PB11.5 不能触发 单击事件,该怎么解决

热度:162   发布时间:2016-04-29 10:34:39.0
透明的statictext 在PB11.5 不能触发 单击事件
PB8里正常
代码如下
forward
global type uo_transparent_st from statictext
end type
end forward

global type uo_transparent_st from statictext
integer width = 521
integer height = 148
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 paint pbm_paint
end type
global uo_transpareDAT* ?nt_st uo_transparent_st

type variables
boolean ib_paintst1
end variables

event paint;if IsValid(this) then //主要是这里的问题
if ib_paintst1 then Return 0
ib_paintst1 = True
Visible = False
Do While Yield()
Loop
Visible = True
ib_paintst1 = False
end if
Return 0
end event

event clicked;//
end event

on uo_transparent_st.create
end on

on uo_transparent_st.destroy
end on

event constructor;backcolor=2^29

end event

那位大哥帮看下,点击一闪一闪的。

------解决方案--------------------
Visible = False 
这名注释下就好了。
不知道会不会有别的问题。
------解决方案--------------------
if IsValid(this) then //主要是这里的问题 
if ib_paintst1 then Return 0 
ib_paintst1 = True 
Visible = False 
Do While Yield() 
Loop 
Visible = True 
//ib_paintst1 = False //这样可以暂时好用
end if 
Return 0 
  相关解决方案