HelpButton: A Button Linked to a Topic of a chm Help File





1.00/5 (1 vote)
May be this will help instead of writing the path all the time:private void showHelp() { string dirpath = string.Empty; //string filename = "ACHWINAPP.chm"; dirpath = System.Environment.CurrentDirectory; string[] files = new...
May be this will help instead of writing the path all the time:
private void showHelp()
{
string dirpath = string.Empty;
//string filename = "ACHWINAPP.chm";
dirpath = System.Environment.CurrentDirectory;
string[] files = new string[100];
do
{
if (dirpath == string.Empty || dirpath == Directory.GetDirectoryRoot(dirpath))
{
MessageBox.Show("no helpfile found");
}
else
{
files = Directory.GetDirectories(dirpath, "ACH");
if (files.Length > 0)
{
//MessageBox.Show(files[0]);
string strHlp = string.Empty;
strHlp = files[0] + "\\ACHWINAPP.chm";
Help.ShowHelp(this, strHlp);
break;
}
else
{
dirpath = Directory.GetParent(dirpath).ToString();
}
}
} while (true);
}