Friday, April 29, 2011

How to make a simple web browser with delphi 7

This tutorial is very simple and easy to use. you can make our own web browser by using delphi software.
first run the delphi software from the windows start menu. and then step by step:
step 1. create a new application. File>New>Application
Now you have a default form that name Form1.
step 2. place one TEdit and TButton. dont forget to place TWebBrowser too. Position at Form1
like this:
step 3. this is the last step to finish our web browser
Double click at Button1 and type the script like this (bold text is the main script) :

procedure TForm1.Button1Click(Sender: TObject);
begin
webbrowser1.Navigate(edit1.Text);
end;

end.

Run our program from green play button or press F9 for fast run.
the program are running, try to write some word to the box.

Example: explore-id.blogspot.com or other site.

after finish the typing press the Button1. then the website will be appear.

Wow that very simple..
Tips: for fast browsing usually after typing we use enter button.
This is the simple tips for you
on the Edit1 Events chose OnKeyPress by double click at the right combo box.
script like this:

procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
if not (Key=chr(13)) then exit;
Button1Click(Sender);
end;
end;

test again by running the program typing and enter.. make sure connect the internet to test browsing.
Well done.. You have made your own web browser now. very fast and simple.

by ramadhani

No comments:

Post a Comment