[TUTORIAL]How to create your own simple browser in DELPHI

Discussion in 'Programming' started by ProgMania, Apr 17, 2007.

  1. #1
    Introduction:
    Hi! I will teach you how to create your own SIMPLE Web browser. This tutorial will show you how to use and controle TWebBrowser. Havent you ever dreamed about your own Webbrowser? Now this is possible, even for you! This tutorial is made for http://www.progmania.dk
    Visit to get more tutorials and How to's.
    Now I will teach you how to get your own SIMPLE browser in just 10 minutes. yes in just 10 minutes! This Webbrowser doesnt have any special functions. It is for the new beginners!

    Please create a new Project (File>New>Application)
    and add following items:

    1 TWebBrowser (name it browser and set it to alClient)
    1 TToolBar (name it to Bar)
    5 TButtons
    1 TEditBox (name it box and set it alTop)


    It should look like this now:

    [​IMG]


    Now lets get to the coding. Here are the buttons:

    procedure TForm1.Button1Click(Sender: TObject);
    begin
      browser.Stop; //This will stop the browser
    end;
    
    procedure TForm1.Button2Click(Sender: TObject);
    begin
      browser.Update; //This will Update the browser
    end;
    
    procedure TForm1.Button3Click(Sender: TObject);
    begin
      browser.GoForward; //This will go Forward
    end;
    
    procedure TForm1.Button4Click(Sender: TObject);
    begin
      browser.GoBack; //This will GoBack in the browser
    end;
    
    procedure TForm1.Button5Click(Sender: TObject);
    begin
      browser.GoHome; //This will go Home
    end;
    
    procedure TForm1.Button6Click(Sender: TObject);
    begin
      browser.Navigate(box.Text); //this will go to the website that is written in the editbox!
    end;
    Code (markup):

    This is a very very simple browser. its for the beginners as I said :) Enjoy :p Next time it will be more complicated!

    Sample: www.progmania.dk/download/browsersimple.zip
     
    ProgMania, Apr 17, 2007 IP
  2. Barti1987

    Barti1987 Well-Known Member

    Messages:
    2,703
    Likes Received:
    115
    Best Answers:
    0
    Trophy Points:
    185
    #2
    What engine is it? IE?

    Peace,
     
    Barti1987, Apr 17, 2007 IP
  3. ProgMania

    ProgMania Active Member

    Messages:
    632
    Likes Received:
    37
    Best Answers:
    0
    Trophy Points:
    70
    #3
    Yes IE, Next time I will make one more advanced and with FF maybe
     
    ProgMania, Apr 17, 2007 IP
  4. Barti1987

    Barti1987 Well-Known Member

    Messages:
    2,703
    Likes Received:
    115
    Best Answers:
    0
    Trophy Points:
    185
    #4
    You know, it would be great if you can teach how to program a unique browser from scratch (it can be as simple as browsing).

    Peace,
     
    Barti1987, Apr 18, 2007 IP
  5. ProgMania

    ProgMania Active Member

    Messages:
    632
    Likes Received:
    37
    Best Answers:
    0
    Trophy Points:
    70
    #5
    Okay. I will maybe try to make a browser from scratch. Thats a little bit hard work but it can be done
     
    ProgMania, Apr 19, 2007 IP