D
DWGZ
Unregistered / Unconfirmed
GUEST, unregistred user!
1: 为什么下面的代码执行以后Form2中的WebBrowser没有内容,如果不这样写应该怎么写
2: 我如何得到WebBorwser中的选中字体信息(像RichEdit中一样),也就是说我可以设置字体,但是我不能得到的状态
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, OleCtrls, SHDocVw, ExtCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
Panel1: TPanel;
WebBrowser1: TWebBrowser;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
uses Unit2;
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
WebBrowser1.Navigate('C:/WINNT/Web/tip.htm');
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
Panel1.Parent := Form2; //WebBorser1放在Panel1里面
Form2.ShowModal;
end;
end.
2: 我如何得到WebBorwser中的选中字体信息(像RichEdit中一样),也就是说我可以设置字体,但是我不能得到的状态
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, OleCtrls, SHDocVw, ExtCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
Panel1: TPanel;
WebBrowser1: TWebBrowser;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
uses Unit2;
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
WebBrowser1.Navigate('C:/WINNT/Web/tip.htm');
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
Panel1.Parent := Form2; //WebBorser1放在Panel1里面
Form2.ShowModal;
end;
end.