我有一个使用Delphi 2006编写的应用程序,并带有一个CHM帮助文件。除了无法让“打开对话框”(TOpenDialog)和“保存对话框”(TSaveDialog)上的“帮助”按钮连接到帮助文件外,一切都运行正常。
下面是一个简单的演示程序。单击按钮2可以打开帮助文件并显示正确的页面。单击按钮1可以打开对话框,但在对话框中单击帮助按钮没有任何效果。
unit Unit22;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls,
HTMLHelpViewer ;
type
TForm22 = class(TForm)
OpenDialog1: TOpenDialog;
Button1: TButton;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form22: TForm22;
implementation
{$R *.dfm}
procedure TForm22.Button1Click(Sender: TObject);
begin
OpenDialog1.HelpContext := 10410 ;
OpenDialog1.Execute ;
end;
procedure TForm22.Button2Click(Sender: TObject);
begin
Application.HelpContext (10410) ;
end;
procedure TForm22.FormCreate(Sender: TObject);
begin
Application.HelpFile := 'c:\help.chm' ;
end;
end.
pmAuto
更接近其他非Delphi应用程序的行为。 - Zoë Peterson