Click here to Skip to main content
15,885,078 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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

VB
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

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


So can any one give the exact one

[edit]Tags corrected to VB from C# - Original Griff[/edit]
Posted
Updated 8-Dec-10 0:44am
v2

1 solution

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".
 
Share this answer
 
Comments
demouser743 8-Dec-10 6:56am    
Ok but if i write as follows

Replace(strPath, "\Release", "\Bin", "\ACHWINAPPLICATION")& "\ACHWINAPP.chm";

I am getting the errors as

Error Unrecognized escape sequence
Manoj from Pune 8-Dec-10 7:05am    
what you want to do by writing "\ACHWINAPPLICATION"??
demouser743 8-Dec-10 7:12am    
Actually my help file is in the folder ACHWINAPP

The actual path is D:\\ACHWINAPP\\ACHWINAPPLICATION\\Bin\Release this is the startuppath i am getting when i write Application.StartupPath so i would like to replace all that stuff
demouser743 8-Dec-10 7:13am    
As my help file is in the folder ACHWINAPP i would like to filter it too from the path

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900