Click here to Skip to main content
Click here to Skip to main content
Alternative Tip

Tagged as

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

, 8 Mar 2011
Rate this:
Please Sign up or sign in to 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);
        }

License

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

Share

About the Author

demouser743
Software Developer
India India
I am Dorababu, working as a Software engineer. Web development in Asp.Net with C#, WinForms and MS sql server are the experience tools that I have had for the past 3 years. Yet to work on WCF, WPF, Silverlight and other latest ones.
Follow on   Twitter   Google+

Comments and Discussions

 
GeneralWhat ever file name it is he has to give the name there i ju... PinmemberDorababu74313-Mar-11 23:05 
GeneralReason for my vote of 1 Explained in my comments. PinmemberOlivier Levrey8-Mar-11 1:48 
General1- Using <CODE>CurrentDirectory</code> is not recommanded si... PinmemberOlivier Levrey8-Mar-11 1:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web02 | 2.8.140902.1 | Last Updated 8 Mar 2011
Article Copyright 2011 by demouser743
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid