帮忙看看这段代码 送分的(50分)

  • 主题发起人 奔腾的堃
  • 开始时间

奔腾的堃

Unregistered / Unconfirmed
GUEST, unregistred user!
动态创建了一个webbrowser之后 没有办法调整他的align属性 怎么回事啊?
帮帮忙阿
unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, OleCtrls, SHDocVw, StdCtrls;

type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;
newform:tform;
newbrowser:twebbrowser;
implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var formhandle:hwnd;
begin
newform:=tform.Create(application);
formhandle:=newform.Handle ;
newbrowser:=twebbrowser.Create(application);
newbrowser.Parentwindow :=formhandle;
newbrowser.Align :=alclient;
newform.Show;
end;

end.
 
不太懂。up一下
 

都帮帮忙阿 我希望能在13号之前写出这个程序 作为给自己的生日礼物 真的很需要帮助阿
 
procedure mytabsheet.createbrowser(sheethwnd:hwnd;w:integer;h:integer);
begin
browser:=twebbrowser.Create(self.Parent );
with browser do
begin
parentwindow:=sheethwnd;
left:=-2;
top:=-2;
width:=w-5;
height:=h;
OnTitleChange:=changetitle;
onnewwindow2:=newwindow;
end;
newbrowser:=browser;
end;
 
你必须指定newbrowser.Parent,而不是newbrowser.Parentwindow
但如何指定,还没有试。
 
这是从我的BROWSER中COPY出来的,完全工作正常
 
不是吧。我怎么记得我以前做的时候,直接用就行了?
 
xiao_min兄 你的代码我看不明白阿 具体说说好么
还有谁有别的办法啊?只剩一天了
 
procedure TForm1.Button1Click(Sender: TObject);
begin
if web=nil then
begin
web:=twebbrowser.Create(self);
web.Parentwindow:=handle;
web.width:=width;
web.Height:=height;
end;
end;
不要用什么ALIGN了,(我这里用那个也不行),直接指定它的WIDTH,跟HEIGHT不就可以了?
 
顶部