Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- unit Unit1;
- interface
- uses
- Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
- Dialogs, ExtCtrls, ImgList, StdCtrls, OleCtrls, SHDocVw, HTTPApp,
- HTTPProd;
- type
- TForm1 = class(TForm)
- Panel1: TPanel;
- Panel2: TPanel;
- WebBrowser1: TWebBrowser;
- Edit1: TEdit;
- Image1: TImage;
- Button1: TButton;
- Button2: TButton;
- Button3: TButton;
- Button4: TButton;
- Button5: TButton;
- procedure FormCreate(Sender: TObject);
- procedure Image1Click(Sender: TObject);
- procedure Button1Click(Sender: TObject);
- procedure Button2Click(Sender: TObject);
- procedure Button3Click(Sender: TObject);
- procedure Button4Click(Sender: TObject);
- procedure FormKeyDown(Sender: TObject; var Key: Word;
- Shift: TShiftState);
- procedure Button5Click(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
- var
- Form1: TForm1;
- nav, back: boolean;
- implementation
- {$R *.dfm}
- procedure TForm1.FormCreate(Sender: TObject);//buscador padrao
- begin
- WebBrowser1.Silent:=true; //blocked script
- Webbrowser1.GoSearch;
- end;
- procedure TForm1.Image1Click(Sender: TObject); //foto
- begin
- Image1.Picture.LoadFromFile('img_527746.bmp');
- end;
- procedure TForm1.Button1Click(Sender: TObject);
- begin
- nav:=True; //navegar
- WebBrowser1.Navigate(Edit1.text);
- end;
- procedure TForm1.Button2Click(Sender: TObject);
- begin
- webbrowser1.GoHome;//home
- end;
- procedure TForm1.Button3Click(Sender: TObject); //goback
- begin
- back:=true;
- if nav=true then
- begin
- WebBrowser1.GoBack;//pagina anterior
- end else
- begin
- showmessage('nenhuma pagina anterior');
- end;
- end;
- procedure TForm1.Button4Click(Sender: TObject); //update
- begin
- if nav=true then
- begin
- webBrowser1.Refresh;//atualiza
- end else
- begin
- showmessage('acesse uma pagina primeiro');
- end;
- end;
- procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;
- Shift: TShiftState);
- begin
- if key=VK_RETURN then //Navegar
- Button1.Click;
- if (GetKeyState(VK_CONTROL) < 0) and (Key =69) then
- Button2.Click;
- //pesquisar
- if key=VK_F5 then //atualizar
- Button4.Click;
- //voltar pagina anterior
- if(GetKeyState(VK_MENU)<0) and (key=37 ) then
- Button3.Click;
- //proxima pagina
- if(GetKeyState(VK_MENU)<0) and (key=39 ) then
- Button5.Click;
- end;
- procedure TForm1.Button5Click(Sender: TObject); //pagina anterior
- begin
- if back=true then
- begin
- WebBrowser1.GoForward;
- end else
- begin
- showmessage('volte primeiro');
- end;
- end;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement