二十、提供帮助函数

二十、提供帮助函数

这组函数让应用程序能够方便地想用户提供帮助信息。

 

1、ShowHelp()

功  能:显示应用程序帮助,该帮助的文件格式可以是传统的Microsoft Windows帮助格式,也可以是编译后的HTML帮助格式。当应用程序调用该函数时,PowerBuilder启动Help可执行文件,并显示做指定的帮助文件。

语  法:ShowHelp ( helpfile , helpcommand {,typeid} )

参  数:helpfile:String类型,指定帮助文件的名称,可以是编译后的HLP文件,也可以是编译后的

CHM(HTML帮助文件)文件;

helpcommand:HelpCommand枚举类型,指定显示帮助的方式。有效值为:

Finder! -- 以用户最近使用过帮助的方式显示帮助;

Index! -- 显示目录主题,使用该值时不要指定typeid参数;

Keyword! -- 转移到指定关键字确定的主题上;

Topic! -- 显示指定主题的帮助;

typeid! -- 可选项,指定帮助主题;

返回值:Integer。函数执行成功时返回1,发生错误时返回-1。当在helpcommand参数中选用了Finder!或

Index,而又指定了typeid参数时,函数返回-1。如果任何参数的值为NULL,ShowHelp()函数返回NULL。

示  例:This statement displays the Help index in the INQ.HLP file:

ShowHelp("C:\PB\INQ.HLP", Index!) 

This statement displays Help topic 143 in the file EMP.HLP file:

ShowHelp("EMP.HLP", Topic!, 143)

This statement displays the Help topic associated with the keyword Part# in the file EMP.HLP:

ShowHelp("EMP.HLP", Keyword!, "Part#")

 

This statement displays the Help search window. The word in the box above the keyword list is the first keyword that begins with M:

ShowHelp("EMP.HLP", Keyword!, "M")

 

2、ShowPopupHelp()

功  能:为控件显示弹出式帮助。

语  法:ShowPopupHelp ( helpfile , control , contextid )

参  数:helpfile:String类型,指定帮助文件的名称,可以是编译后的HLP文件,也可以是编译后的

CHM(HTML帮助文件)文件;

control:要显示弹出式帮助的可拖拽对象,通常是控件;

contextid:Long类型,相应控件对应帮助的标识号。

返回值:Integer。函数执行成功时返回1,发生错误时返回-1。

示  例:This example calls a help file in a subdirectory of the current directory:

ShowPopupHelp ( "Help/my_app.hlp", this, 510)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值