C
CJ
Unregistered / Unconfirmed
GUEST, unregistred user!
Import 了 IE 的 ActiveX 控件,如何让其打印?我用以下方法:
procedure TForm1.PrintDoc;
var
v1,v2,v3,v4:OleVariant;
begin
try
v1 := OLECMDID_PRINT;
WebBrowser1.ExecWB(v1,v2,v3,v4);//乱七八糟的什么东西
except
end;
end;
整个程序如下,恶简单:
const
MAIN_LOCATION = 'C:/HYHTML/INDEX.HTM';
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.GotoPage(ReqUrl: string);
var
v1, v2, v3, v4: OleVariant;
begin
try
WebBrowser1.Stop;
WebBrowser1.Navigate (ReqUrl, v1, v2, v3, v4);
except
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
Top := 0;
Left := 0;
Width := Screen.Width;
Height := Screen.Height;
WebBrowser1.Stop;
if ParamCount >= 1 then
GotoPage(ParamStr(1))
else
GotoPage(MAIN_LOCATION);
end;
procedure TForm1.ToolbarButton972Click(Sender: TObject);
begin
Showmessage('信息查询系统 BY CJ')
//药
end;
procedure TForm1.TransparentButton1MouseEnter(Sender: TObject);
begin
with (Sender as TTransparentButton).Font do
begin
Style := [fsItalic,fsBold];
Color := clRed;
end;
end;
procedure TForm1.TransparentButton1MouseExit(Sender: TObject);
begin
with (Sender as TTransparentButton).Font do
begin
Style := [];
Color := clBlue;
end;
end;
procedure TForm1.TransparentButton5Click(Sender: TObject);
begin
try
WebBrowser1.GoBack;
except
end;
end;
procedure TForm1.TransparentButton7Click(Sender: TObject);
begin
try
WebBrowser1.GoForward;
except
end;
end;
procedure TForm1.TransparentButton8Click(Sender: TObject);
begin
Close;
end;
procedure TForm1.TransparentButton10Click(Sender: TObject);
begin
try
WebBrowser1.Refresh;
except
end;
end;
procedure TForm1.TransparentButton1Click(Sender: TObject);
var
s:string;
begin
s := InputBox('输入文件名','输入文件名','');
if s <> '' then
GotoPage (s);
end;
procedure TForm1.PrintDoc;
var
v1,v2,v3,v4:OleVariant;
begin
try
v1 := OLECMDID_PRINT;
WebBrowser1.ExecWB(v1,v2,v3,v4);
except
end;
end;
procedure TForm1.TransparentButton2Click(Sender: TObject);
begin
PrintDoc;
end;
end.
procedure TForm1.PrintDoc;
var
v1,v2,v3,v4:OleVariant;
begin
try
v1 := OLECMDID_PRINT;
WebBrowser1.ExecWB(v1,v2,v3,v4);//乱七八糟的什么东西
except
end;
end;
整个程序如下,恶简单:
const
MAIN_LOCATION = 'C:/HYHTML/INDEX.HTM';
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.GotoPage(ReqUrl: string);
var
v1, v2, v3, v4: OleVariant;
begin
try
WebBrowser1.Stop;
WebBrowser1.Navigate (ReqUrl, v1, v2, v3, v4);
except
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
Top := 0;
Left := 0;
Width := Screen.Width;
Height := Screen.Height;
WebBrowser1.Stop;
if ParamCount >= 1 then
GotoPage(ParamStr(1))
else
GotoPage(MAIN_LOCATION);
end;
procedure TForm1.ToolbarButton972Click(Sender: TObject);
begin
Showmessage('信息查询系统 BY CJ')
//药
end;
procedure TForm1.TransparentButton1MouseEnter(Sender: TObject);
begin
with (Sender as TTransparentButton).Font do
begin
Style := [fsItalic,fsBold];
Color := clRed;
end;
end;
procedure TForm1.TransparentButton1MouseExit(Sender: TObject);
begin
with (Sender as TTransparentButton).Font do
begin
Style := [];
Color := clBlue;
end;
end;
procedure TForm1.TransparentButton5Click(Sender: TObject);
begin
try
WebBrowser1.GoBack;
except
end;
end;
procedure TForm1.TransparentButton7Click(Sender: TObject);
begin
try
WebBrowser1.GoForward;
except
end;
end;
procedure TForm1.TransparentButton8Click(Sender: TObject);
begin
Close;
end;
procedure TForm1.TransparentButton10Click(Sender: TObject);
begin
try
WebBrowser1.Refresh;
except
end;
end;
procedure TForm1.TransparentButton1Click(Sender: TObject);
var
s:string;
begin
s := InputBox('输入文件名','输入文件名','');
if s <> '' then
GotoPage (s);
end;
procedure TForm1.PrintDoc;
var
v1,v2,v3,v4:OleVariant;
begin
try
v1 := OLECMDID_PRINT;
WebBrowser1.ExecWB(v1,v2,v3,v4);
except
end;
end;
procedure TForm1.TransparentButton2Click(Sender: TObject);
begin
PrintDoc;
end;
end.