怎么在PB9中实现在静态文字控件上显示提示


如何在PB9中实现在静态文字控件上显示提示?
我有一窗口界面,上面有很多静态文本控件,需要在鼠标移动到每个文本控件上时在旁边显示提示信息,在PB9能实现吗?

在网上找了很久都没能解决,希望大家帮帮我,这个项目现在比较紧急。

如果大家有封装好的控件,发给我也行,非常感谢!

我的邮箱:

PowerBuilder语言基础 PowerBuilder 程序开发

不良的鱼2号 10 years, 7 months ago


楼主,你的问题解决了吗?解决后,请分享一下

miumiu子 answered 11 years, 1 month ago




371622500000.jpg

我爱Sugar answered 11 years, 1 month ago


pb11.0 之后的版本 都 自带此功能了。

没睡醒的肉啊 answered 11 years, 1 month ago


最近回复过得帖子,被希赛给沉了,重新顶起

lvmusic answered 11 years, 1 month ago


下面有两个对象,你讲它们分别保存为uostatictext.sru 和 nvotooltips.sru ,然后导入pbl文件
再对你的窗口中进行Edit Source,然后将Edit Source看到的内容中的from statictext 全部替换为from uostatictext即可。其他控件也可以仿照uostatictext控件的写法添加tip

(1)uo_statictext.sru

  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 = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 67108864 string text = "none" boolean focusrectangle = false event ue_mousemove pbm_mousemove end type global uo_statictext uo_statictext type variables public: integer tipicon = 0 //提示框显示的图标:TTI_NONE=0,TTI_INFO=1,TTI_WARNING=2,TTI_ERROR=3 string tiptitle = '' //提示框显示的标题 rowfocusind Tooltiptype = hand! //提示框显示类型:hand! 为气泡型提示框, focusrect! 为方框型提示框, off!为不显示 private: nvo_tooltips invo_tooltip int i_uid end variables event ue_mousemove;invo_tooltip.of_relaymsg( this, 512) //512代表鼠标移动是显示tooltip end event on uo_statictext.create end on on uo_statictext.destroy end on event constructor;invo_tooltip.of_set_tippro( tipicon, tiptitle, TOOLTIPTYPE) i_uid = invo_tooltip.of_addtool( this, this.tag, 0) //以控件的tag属性为tip内容 end event

我是一名演员 answered 11 years, 1 month ago

Your Answer