![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Hobbyist Programmer
|
Creating a Web Browser
Right, this is my attempt to give back to the community and help out the even more noobish than I. I thought I'd write about something really simple that I could do in my sleep so there was no chance I'd get it wrong!:
This tutorial will tell you how to create a web browser in less than 10 minutes and is actually really easy: I use Microsoft's VB.NET as a compiler. It's really easy to use and does most of the hard work for you. If you have not yet downloaded and installed it, then do so. Create a new Windows Application (File --> New) and then resize the default form to your liking! The main part of the web browser is contained within the next stage. From the toolbox, drag a WebBrowser onto the form and make it the dimensions you want. Next drag a text box and button underneath it. Call the web browser "browser1", the text box "tbox1" and the button "button1". Now for the actual coding. Double click on the button and add the following code in the appropriate place: browser1.Navigate(tbox1.Text) Now exit code view and press F5 to run. Your own web browser! In less than the time it takes to start IE (almost - lol)! Any questions or if it doesn't work please let me know! |
|
|
|
|
|
#2 |
|
Professional Programmer
Join Date: Jan 2006
Location: Ontario, Canada
Posts: 375
Rep Power: 0
![]() |
Why would you give your control names like tbox1 and button1? That is horrible naming convention. Something like txtURL and btnNavigate are far more suitable because they actually explain what the control might be used for.
__________________
I am Addicted to Linux! |
|
|
|
|
|
#3 |
|
Hobbyist Programmer
|
King, I also am addicted to Linux - still that is totally irrelevant for now so I won't get into it.
In a small program like that there is no point - I just type the first thing which comes into my rather unimaginative mind. It's a tiny program with only one button in it so it's obvious which one you'd be referring to so why not call it "Bob" or "Jim" or something. LOL. But thanks for the advice and I might further follow this new convention in some of my longer programs rather than just calling the long names including their x and y coordinates. LOL. |
|
|
|
|
|
#4 |
|
Professional Programmer
Join Date: Jan 2006
Location: Ontario, Canada
Posts: 375
Rep Power: 0
![]() |
If this wasn't a tutorial and you were just showing it off I wouldn't have said anything, but it is, so you should be teaching people new to programming good practices such as naming convention even on a small app like that.
__________________
I am Addicted to Linux! |
|
|
|
|
|
#5 |
|
Hobbyist Programmer
|
Yes well I doubt anyone's going to be looking at it anyway so is there really any point complaining? Why be so negative?
|
|
|
|
|
|
#6 |
|
Professional Programmer
Join Date: Jan 2006
Location: Ontario, Canada
Posts: 375
Rep Power: 0
![]() |
I was a bit negative in the first post, not in the second. The second one I was just explaining why you should have properly named the controls... especially because you went through the trouble of changing the control name, so it would take no extra effort in naming it something a bit more descriptive.
Enough of that. I remember in high school programming in VB6 when I discovered the WebBrowser control (about 4 years ago), I was one happy dude. I spend 2 weeks adding my own buttons and all that stuff. It was pretty slick lol.
__________________
I am Addicted to Linux! |
|
|
|
|
|
#7 |
|
Programmer
|
never seen/heard of said control... must look into this. but nonetheless, always rename the controls... readability is always good to have no matter the project.
__________________
My site :: http://www.freewebtown.com/dougalbe I'll try to be nicer, if you try being smarter. |
|
|
|
|
|
#8 |
|
Professional Programmer
Join Date: Jan 2006
Location: Ontario, Canada
Posts: 375
Rep Power: 0
![]() |
I wouldn't bother. The control is based off of IE and doesn't seem to perform as well, with no options to fuss with the inner workings of it. It's just a fun exercise when you are first learning how to program in VB/C#. Other than that there is really no use to it unless you really hate the look of IE or Firefox.
__________________
I am Addicted to Linux! |
|
|
|
|
|
#9 |
|
Hobbyist Programmer
|
Excuse me. Any sort of program that you want to display a page of the web (quite a few that I've done recently actually) this command is very, very useful.
|
|
|
|
|
|
#10 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
It's a fairly common control, these days. For example, wxWidgets has one. The question is: how closely does the rendering conform to W3C recommendations in its entirety? Generally speaking, I would say, "not very".
In the following illustration, the box at the bottom of the window is an html control. After initializing it (size, position, etc.), I merely have to treat it as a object that has some predefined methods. For example, "myHtmlControl.LoadFile ("hootchiefile.htm"). All the work (however comprehensive that may be) was done by someone else. Bless their li'l peapickin' hearts. ![]()
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Special browser in Java (Project) | stalefish | Java | 3 | Feb 9th, 2008 4:22 PM |
| Browser With PHP Bulit In | PhilBon | PHP | 5 | Dec 4th, 2006 11:43 PM |
| building a browser toolbar | va1damar | Java | 2 | Mar 20th, 2006 9:29 AM |
| creating browser toolbar | va1damar | Project Ideas | 2 | Mar 15th, 2006 2:45 PM |
| creating an application that stands between the browser and the serve | ronias | Visual Basic | 5 | Oct 30th, 2005 4:22 PM |