任何人都可以修改此代码并提供适当的代码 [英] Can any one modify this code and give the appropriate one

查看:84
本文介绍了任何人都可以修改此代码并提供适当的代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从这里找到了这段代码

http://www.eggheadcafe. com/community/aspnet/2/10064589/how-to-use-help-file-in-net-20.aspx [

I found this code from here

http://www.eggheadcafe.com/community/aspnet/2/10064589/how-to-use-help-file-in-net-20.aspx[^]

Code is as follows

Private Sub cmdControl2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _
 Handles cmdControl2.Click
   Dim sHelpFile As String
   Dim sStartupPath As String
   '--- Initialize context-sensitive help ---
   sStartupPath = Application.StartupPath.ToString
   sHelpFile = Replace(sStartupPath, "\bin", "\hlp") & "\VBnetCHM.chm"
   Me.hlpProvider1.HelpNamespace = sHelpFile
   Me.hlpProvider1.SetHelpNavigator(Me.cmdControl1, HelpNavigator.KeywordIndex)
   Me.hlpProvider1.SetHelpKeyword(Me.cmdControl1, "Help topic of control 1")
 End Sub



我尝试编写此代码,但没有明白这行对
的含义



I tried of writing this but i did not get what this line meant for

sHelpFile = Replace(sStartupPath, "\bin", "\hlp") & "\VBnetCHM.chm"



所以任何人都可以给出确切的一个

[edit]已将标签从C#纠正为VB-原始格里夫[/edit]



So can any one give the exact one

[edit]Tags corrected to VB from C# - Original Griff[/edit]

推荐答案

替换功能用于将stratup路径的"\ bin"字符串替换为"\ hlp",并将"VBnetCHM.chm"附加到该新路径.
因此,sHelpFile将包含应用程序启动路径,然后是"\ hlp"然后是"\ VBnet.chm".
Replace function is use to replace the "\bin" string of stratup path with "\hlp" and append "VBnetCHM.chm" to that new path.
So sHelpFile will contain Application startup path then "\hlp" then "\VBnet.chm".


这篇关于任何人都可以修改此代码并提供适当的代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆