如何从VS Lightswitch中的按钮打开chm文件

本文关键字:按钮 chm 文件 VS Lightswitch | 更新日期: 2023-09-27 18:35:28

我需要在按钮的can_execute()方法中输入什么样的代码才能打开我为Lightswitch应用程序制作的.chm帮助文件,我将如何确保即使在发布整个应用程序之后....chm文件会自动传输到用户的计算机中,并保留在正确的目录中? .....谢谢!

 partial void Help_Execute()
    {
        // Write your code here.
        if (AutomationFactory.IsAvailable)
        {
            dynamic shell = AutomationFactory.CreateObject("Shell.Application");
            shell.ShellExecute("C:/Users/Thuto/Documents/Visual Studio 2010/Projects/ElectricalContructors/ElectricalContructors/Client/Resources/SparkHelpDocumentation.chm", "", "", "open", 1);
        }
        else
        {
            this.ShowMessageBox("Automation not available");
        }
    }

经过一个小时的尝试寻找更好的方法,我尝试了这个并且它有效,但我想知道正确的方法,谢谢!

如何从VS Lightswitch中的按钮打开chm文件

这是一篇关于在客户端使图像嵌入资源的文章。我还没有用 .chm 尝试过,但我不明白为什么它不应该工作。

http://blogs.msdn.com/b/bethmassi/archive/2011/06/15/adding-static-images-and-text-on-a-lightswitch-screen.aspx