Page 1 of 1

how to write in vb if http:// or https:// is not in string..

Posted: Sat Feb 19, 2005 8:30 am
by sparkicks
Ok i have taken making an internet explorer to the next level by making one of my own to give away on my site but how would you make it that it includes the http:// if it isnt there

Posted: Sat Feb 19, 2005 8:44 am
by Thebirthdayhat
i dont really understand wat ure asking, do u mean after u go to a website make it have http//: aht the begining. xplain more of wat u mean then amybe i can help

Posted: Sat Feb 19, 2005 8:46 am
by sparkicks
ok normally if you type in www.google.com it will go into it and put in the http:// but in the program if you just leave it , it wont. it will do nothing if u dont put in http.

Posted: Sat Feb 19, 2005 5:35 pm
by Cheech|N|Chong
lol i doubt someone thats 13 can make a better internet explorer...this was built by PROFESSIONALS from Microsoft...GL anyway :?

Posted: Sat Feb 19, 2005 6:24 pm
by Phenomena
web browsers arnt to hard to make lol

Posted: Sat Feb 19, 2005 7:19 pm
by Cheech|N|Chong
duh...but no way he can make it better than I.E.

Posted: Sat Feb 19, 2005 8:08 pm
by Jefff
IE isn't that good. It's just bundled with windows so everyone uses it. Back on topic, what language are you programing this browser in?

Posted: Sat Feb 19, 2005 8:40 pm
by Thebirthdayhat
i think this si wat ure talking bout.

say that the thing u type the url in is named text1 and the explorer thing is named webbrowser1, type this in the code

webbrowser1.navigate = "http//:" + text1.Text

that might work i have no idea im just guessing

Posted: Sat Feb 19, 2005 9:09 pm
by Jefff
But if the person already typed http:// that wouldn't work. If it's vb use this.

Code: Select all

If LCase(Left(URL, 7)) <> "http://" Then URL = "http://" + URL

Posted: Sun Feb 20, 2005 9:32 am
by sparkicks
Thebirthdayhat wrote:i think this si wat ure talking bout.

say that the thing u type the url in is named text1 and the explorer thing is named webbrowser1, type this in the code

webbrowser1.navigate = "http//:" + text1.Text

that might work i have no idea im just guessing
it works all right but when i go to run it , it says there is an error but it still runs

Posted: Sun Feb 20, 2005 9:43 am
by Jefff
What is the error?

Posted: Sun Feb 20, 2005 10:01 am
by sparkicks
sry it doesnt matter the error was something to do with another thing i fixed but i still got the problem with the http if the user types it in , it doesnt get the address and one more thing how would i make it that it gets the address when i press enter aswell and Cheech|N|Chong i would just have to say that internet explorer is so crap and vb is so easy (and kinda booring cus of it) that it would take me 1 day flat out to make a new one that would be better then it but i cant prove that cus i always will have something to do and ne way the pizza would run out =)

Posted: Sun Feb 20, 2005 10:23 am
by Jefff
On key down use this code:

Code: Select all

If KeyCode = vbKeyReturn Then
 'Code for enter key goes here
End If

Posted: Sun Feb 20, 2005 10:52 am
by Thebirthdayhat
Private Sub Form_KeyPress(KeyAscii As Integer)
Select Case keycode
Case vbKeyReturn
"coding for watever u want to happen goes here"
End Select
End Sub
theres just another option that i like to use more often.

Posted: Tue Feb 22, 2005 12:22 pm
by kaptainkommie
[gx]_aaron wrote:web browsers arnt to hard to make lol
Oh of course not if you use VB's Internet Explorer control.