VCL.Net 之家

探讨VCL.Net的技术,特别是从VCL迁移到VCL.Net的经验和技巧

导航

How to show help (.CHM) in VCL.Net application?

I have tried several ways which are used to work for VCL application but no success. So I was wondering how a .Net application use help file written in CHM? By searching in CNBLOGS, I found the article 如何通过C#调用CHM帮助文件. So I wrote a test VCL.Net application which have a menu item named "PMOHelp1", its click event handler as below:

procedure TFormMain.PMOHelp1Click(Sender: TObject);
begin
  Help.ShowHelp(System.Windows.Forms.Form.Create , Borland.Vcl.Forms.Application.HelpFile  )
end;

because Help.ShowHelp requires a control within System.Windows.Forms namespace, so the code just create a unnamed WinForm's Form(which is different from VCL's Form). VCL/VCL.Net application can store its help file's name in the global variable Application's property "HelpFile", but because there is also an Application variable in WinForm, so the code needs to point out which one it should use.

Above just another example shows that VCL.Net can coexist or can take advantage of WinForm's technic very well.

posted on 2006-07-19 07:25  Bo Chen Lin  阅读(374)  评论(0编辑  收藏  举报