Page 1 of 2

Programming: VB Programming Tutorial #2

Posted: Sat Oct 23, 2004 12:07 am
by Locke
Well I finaly got enough time to write another tut.Sry to leave you guys hanging with the last one.With that said,lets begin

I will assume you know the basics by following the Visual Basic Programming Tutorial #1 so I wont have to repeat myself

Today,you will be learning something a bit more comlicated.But still easy.You will be learning how to make your own web browser.

Open vb and select Standard exe.Drag out the form so it looks like this
Image
Go over into the properties menu and change the name Form1 to frmExplorer2
Then change the caption to Explorer 2

Not hold control and press the letter "T"
A menu should appear.Scroll down to Microsoft Internet Controls.Check the box and click ok.
Image

Now a picture of the world has been added to your tool box.
Image
Click on it,and drag it out onto the form.
Image
Now clcik on a text box,and drag it out onto the form.
Image
Click on the txt box and go down in the properties menu to Text
Change it from "Text1"to " "

Now drag out a command button onto the form.Change the name from "Command1" to "cmdgo"
Now change the caption to "Go!"
Image
Looks kinda familiar now.
Now for the coding wich is very simple
Double click cmdgo
Now type
WebBrowser1.Navigate Text1.Text
Image

Press F5 to run the program.Type the url into the textbox and press Go!
Image

And thats a web browser.But if you want to create a little bit more.Continue on

Create a new command button and name it cmdback.Then change the caption to "Back"
Then add another command button and name it cmdforward.Then change the cpation to "Forward"
Image
Double click on cmdback and type

On Error GoTo Error
WebBrowser1.GoBack
Error:
Exit Sub


Then double click on cmdforward.And type

On Error GoTo Error
WebBrowser1.GoForward
Error:
Exit Sub

Now when you are in the explorer,you can go back,and forward.

That ends this tut.Ill post more when I get my next break.Feedback please

Posted: Sat Oct 23, 2004 9:22 am
by Spartan Foods
Very nice dude, looove it!

Posted: Sat Oct 23, 2004 9:29 am
by kaptainkommie
Good job man.

Posted: Tue Oct 26, 2004 1:01 pm
by Pie
I hope to see more from you, buddy

Posted: Tue Oct 26, 2004 2:06 pm
by DMJefff
For Visual Basic examples and examples for a lot of other programming languages go to http://www.pscode.com. I've learned a ton from that site.

Posted: Thu Nov 04, 2004 4:13 pm
by [CL]9mm-Man
Im making a version of it for my clan, Chaos Legion. Does any one know a code so when you click a button it like puts the url in the text box and you can click Go, Cuz I want to make a menu with Links and have like all different Halo links. And I want to program it so when you click it, a link pops up in the text bar (thing where you put address)

Posted: Thu Nov 04, 2004 4:39 pm
by [CL]9mm-Man
Never Mind, I worked it out. Ill post a screenshot of it soon.

Posted: Thu Nov 04, 2004 7:45 pm
by Locke
[CL]9mm-Man wrote:Never Mind, I worked it out. Ill post a screenshot of it soon.
Ok, I would help you next time. Im me

Posted: Fri Nov 05, 2004 9:22 am
by [CL]9mm-Man
Hehe I did but you where away

Posted: Fri Nov 05, 2004 12:36 pm
by Locke
[CL]9mm-Man wrote:Hehe I did but you where away
Ill be away for a while. IM me in about 6 hours. Or ill im you.

Posted: Fri Nov 12, 2004 11:07 pm
by [users]TheKeihatsu
ohh, even though it doesnt have any importance to modding, can i make a tutorial on how to make a webbrowser with the winsock control, or the winsock dll. hehe. However i think ill make a tutorial on making a quick hex editor in VB. Probably in .net, cause its file system and file manipulation is faster. But ill do it in VB6 just for those who cant get .net

Posted: Sat Nov 13, 2004 10:31 am
by [CL]9mm-Man
Okay well I made my version a few days ago, and I just took a picture of it to show you :).. Tell me what you think. I added links and stuff and some how it I got it to work as a homepage. I put a url in the text box so I think when it loads up it loads that page.
Image

Hey TheKeihatsu good idea, what ever you want to do. I'll still read the tutorial :)

Posted: Sun Nov 14, 2004 11:03 am
by mojo
im working on making a favorites list and a button on it to set homepage,
for the favorites list i want to no how to make it so when i click a button that says favorites itll open a msg box with a list of links but i cant make the in list form i can only make it so there all in same horizontal axis like

1
2
3
4
not like

1234


also how do i make it so without going back into vb i can add things to favorites list, like a text box with a submit button and itll automatically add it to the list can sum1 help.
also once i finish can sum1 convert to exe for me i only have trial

Posted: Sun Nov 14, 2004 11:26 am
by Locke
For the message box type

MsgBox "1" + vbCrLf + "2"+vbcrlf+"3"+vbcrlf+"4", vbInformation, "Message"

vbcrlf, just tells it to go to a new line.

Posted: Sun Nov 14, 2004 11:49 am
by [CL]9mm-Man
The links bit on mine is sorta like a favourites, but you can't add any links, thats just ones I put on.

Posted: Thu Nov 18, 2004 5:49 pm
by halo mods rock
how you make links on msg box?

Posted: Tue Jun 21, 2005 8:12 am
by looknbarrel
how do you make it so that it saves the websites you went to and it shows them in a drop down arrow

Posted: Tue Jun 21, 2005 10:37 am
by [CL]9mm-Man
You would need to code a history, I would save it in a txt or some thing and make sure that under *Yourprogram_Load it loads that text file into the drop down box, you may need a timer to automatically save the text every so often. Or how I would code it was everytime you press the Go button, or enter, it creates the text with the address in.

Posted: Tue Jun 21, 2005 5:33 pm
by looknbarrel
Yeah thats what i meant im new so how would i do this

Posted: Thu Aug 11, 2005 5:07 pm
by ezekiel72
wow i didnt know web browsers were that simple :mrgreen: