Programming: VB Programming Tutorial #2

Post here about scripting and programming for HaloPC (audio, network, ai, etc.)
User avatar
Locke




Socialist Advisor Translator

Posts: 2225
Joined: Fri Aug 06, 2004 1:42 am
Location: Woot.com
Contact:

Programming: VB Programming Tutorial #2

Post 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
Image
Feel free to send me an instant message if you need anything.
Spartan Foods




Pyre

Post by Spartan Foods »

Very nice dude, looove it!
kaptainkommie




Wordewatician 500

Posts: 732
Joined: Wed Nov 26, 2003 11:59 pm
Location: Raleigh, NC, USA

Post by kaptainkommie »

Good job man.
Pie





Posts: 2690
Joined: Wed Mar 10, 2004 8:46 am
Location: Bedford \ Nashua, New Hampshire
Contact:

Post by Pie »

I hope to see more from you, buddy
Image
Thank You, SHOUTrvb, For This Fantastic Signature :mrgreen:
DMJefff





Posts: 2
Joined: Mon Oct 25, 2004 2:34 pm

Post 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.
[CL]9mm-Man




Wordewatician 500

Posts: 773
Joined: Tue May 04, 2004 7:14 am
Location: Uranus

Post 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)
Your image cannot exceed 400x200 or 50kb
[CL]9mm-Man




Wordewatician 500

Posts: 773
Joined: Tue May 04, 2004 7:14 am
Location: Uranus

Post by [CL]9mm-Man »

Never Mind, I worked it out. Ill post a screenshot of it soon.
Your image cannot exceed 400x200 or 50kb
User avatar
Locke




Socialist Advisor Translator

Posts: 2225
Joined: Fri Aug 06, 2004 1:42 am
Location: Woot.com
Contact:

Post 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
Image
Feel free to send me an instant message if you need anything.
[CL]9mm-Man




Wordewatician 500

Posts: 773
Joined: Tue May 04, 2004 7:14 am
Location: Uranus

Post by [CL]9mm-Man »

Hehe I did but you where away
Your image cannot exceed 400x200 or 50kb
User avatar
Locke




Socialist Advisor Translator

Posts: 2225
Joined: Fri Aug 06, 2004 1:42 am
Location: Woot.com
Contact:

Post 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.
Image
Feel free to send me an instant message if you need anything.
[users]TheKeihatsu





Posts: 19
Joined: Mon Oct 25, 2004 5:39 pm

Post 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
Signature exceeded 75KB.
[CL]9mm-Man




Wordewatician 500

Posts: 773
Joined: Tue May 04, 2004 7:14 am
Location: Uranus

Post 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 :)
Your image cannot exceed 400x200 or 50kb
mojo





Posts: 30
Joined: Sun Apr 04, 2004 5:09 pm

Post 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
User avatar
Locke




Socialist Advisor Translator

Posts: 2225
Joined: Fri Aug 06, 2004 1:42 am
Location: Woot.com
Contact:

Post 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.
Image
Feel free to send me an instant message if you need anything.
[CL]9mm-Man




Wordewatician 500

Posts: 773
Joined: Tue May 04, 2004 7:14 am
Location: Uranus

Post 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.
Your image cannot exceed 400x200 or 50kb
halo mods rock





Posts: 32
Joined: Mon Jul 26, 2004 4:54 am
Contact:

Post by halo mods rock »

how you make links on msg box?
looknbarrel




Coagulator Miner

Posts: 467
Joined: Sat Mar 19, 2005 7:59 pm

Post 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
[CL]9mm-Man




Wordewatician 500

Posts: 773
Joined: Tue May 04, 2004 7:14 am
Location: Uranus

Post 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.
Your image cannot exceed 400x200 or 50kb
looknbarrel




Coagulator Miner

Posts: 467
Joined: Sat Mar 19, 2005 7:59 pm

Post by looknbarrel »

Yeah thats what i meant im new so how would i do this
ezekiel72





Posts: 36
Joined: Tue Jun 07, 2005 1:49 pm

Post by ezekiel72 »

wow i didnt know web browsers were that simple :mrgreen:
Only 3 lines of text are allowed
Post Reply