• Log in or sign up for an account here: https://www.sythe.org/login

A few questions

0h n035

Active Member
Joined
Feb 1, 2007
Sythe Gold
0
Messages
163
Location
Australia
Okay.

I'm trying to make two things.

A Web Browser and a Full Screen Window (Pretty much the same as the Web Browser, just with no toolbars) for my Web client.

Firstly, the Web Browser. This is my code:
Code:
Private Sub cboURL_Change()
 If KeyCode = vbKeyReturn Then
    Wweb.Navigate cboURL.Text
 End If
End Sub

Private Sub cmdBack_Click()
Wweb.GoBack
End Sub

Private Sub cmdForward_Click()
Wweb.GoForward
End Sub

Private Sub cmdStop_Click()
Wweb.GoBack
End Sub

Private Sub cmdRefresh_Click()
Wweb.Refresh
End Sub

Private Sub Combo1_Change()

End Sub

Private Sub Form_Load()
Wweb.Navigate ("http://www.ryanslair.com/BloodVulturesClan")
End Sub

Now... When I type in a URL it does nothing. Also I want my button 'GO' to do what GO does in a normal browser. So when you click it, it navigates to the page in the URL box.

Also, for some reason links do nothing. And sometimes when I load a page it comes up with errors about the code. How do you make it so the errors don't pop-up (If it's possible). And is there away for my Back Buttons, etc to change to another image onclick and when you release it goes back to normal. My buttons are images just so you know.

Oh and when I had it going good and I forgot to save it, I could type in URLS and I'd go there. The only thing was, when I clicked back, It didn't change the URL in te combo box.

Now with the webclient part. It did the same thing with the errors and I wanna get rid of em. Also RuneScape and my Chatroom didn't load up. They do on IE and FF but it just comes up with an X in the Client.

I have to go and I can't explain anymore.

Thanks.
 
change this:
Code:
Private Sub cboURL_Change()
 If KeyCode = vbKeyReturn Then
    Wweb.Navigate cboURL.Text
 End If
End Sub
to
Code:
Private Sub cboURL_Keypress(Keyascii as integer)
 If keyascii = 13 Then
    Wweb.Navigate cboURL.Text
 End If
End Sub

as for the command button thing, make the name of your button that says "GO", "cmdgo". and add this code.
Code:
private sub cmdgo_click()
Wweb.Navigate cboURL.Text
end sub
 
Thanks Covey! The Go button worked but it still wont update the combo box with the new link when you click back or forward.

Also, even if you don't know the code, is it possible to get rid of that dumb error message. Every time theres a small error on the page it always brings up a message but then page still loads up fine.

I find it quite annoying so I there's anyway to get rid of it, please tell me :)

Ooh yeah I just remembered. When I type in a URL it doesn't save it to the combo box. Is there any way of doing that? I'm looking it up on google now so I'll post back if i find the answer.
 
Ok, to get rid of those annoying messages put this code in where ever the error is occurring...
Code:
On Error Resume Next
To get the combo box to say what URL you are at put this in the code:
Code:
Private Sub Wweb_NavigateComplete2(ByVal pDisp As Object, URL As Variant)
    cboURL.Text = Wweb.LocationURL
End Sub

Anything else?
 
There is no error in the VB project itself, It's just an error that comes up when a page has script errors.

You know how on IE in the status bar it says Done but with errors on page?

Yeah, if theres any way for those errors to show up like that or not show up at all, that'd be great.

Thanks so much for the script though.

Works great.
 
Okay, I'll try that

All I need now is to Make the combo box remember the URLS you type in and find out why java applets wont work in the browser.
 
Change this...
Code:
Private Sub Wweb_NavigateComplete2(ByVal pDisp As Object, URL As Variant)
    cboURL.Text = Wweb.LocationURL
End Sub
to this...
Code:
Private Sub Wweb_NavigateComplete2(ByVal pDisp As Object, URL As Variant)
    cboURL.Text = Wweb.LocationURL
    cboURL.AddItem = Wweb.LocationURL
End Sub

Have fun, and do you mean you want a status bar like IE as?
 
Oh, I fixed the script error problem.

But when I did the code above, I got this error:

Compile Error:

Argument not optional.

It highlighted the top line of the code you gave me.

Oh, a few other things that I need to know...

I added my own Google Search thing but how do I make it so when you press enter, it does the search rather than having to press go.

Last thing is, I want to change the cursor to the pointing hand when it points over some of the buttons.
 
Change
Code:
cboURL.AddItem = Wweb.LocationURL
to...
Code:
cboURL.AddItem Wweb.LocationURL

And I think that the Press Enter to do something code is...
Code:
Private Sub cboURL_KeyPress(KeyAscii As Integer)
    If KeyAscii = 13 Then
        Wweb.Navigate cboURL.Text 'Or whatever the googlesearch box is called?
    End If
End Sub

And last but not least: VB6 doesnt have the Hand imbedded inn it so you'll have to make an imagebox with that picture in it make then add this code to the MouseOver command...
Code:
buttonname.MousePointer = 99
buttonname.MouseIcon = ImageBox.picture
 
Could you give me an example of the mouse pointer code?

Also is there any way to do OnMouseover and OnMouseDown and OnMouseUp Commands?

I want the button to change OnMouseOver and OnMouseDown I want it to change and when you lift the mouse button it goes back to normal.

Oh and I got the Additem thing working. Same with the pressing enter thing. I did that but I accidentally added the code to my GO button before :P

One more question. The Additem thing adds them to the bottom of the list. How can I make it add the top. Oh and It also adds Iframes (But it only adds the main page to the list) to it. Anyway to stop that?

What I mean with the Iframe thing...

Theres a page called www.blah.com with Iframes. The iframe page is blah.com/blah.html. In the address bar it doesnt add blah.com/blah.html, It just adds www.blah.com for however many Iframes there are.

Sorry for so many questions, just wanna make it alot better.
 
NVM I did the OnClick stuff.

Is there anyway I can hide images OnMouseover and show them again OnMouseout

EDIT:

***NVM, I FIXED THE CLICKING BUTTON THINGS****

Oh and ANOTHER things. When you click an item in the list it just goes in the combo box typing spot. I want it so when you click an item, it puts it there and visits the site.
 
Code:
Private Sub Command1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Image1.Visible = False
End Sub

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Image1.Visible = True
End Sub
 
Code:
Private Sub Command1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Image1.Visible = False
End Sub

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Image1.Visible = True
End Sub

They changed Onmouseover, just not Onmouseout
 
hmmmm....try google...
 
NVM

The mouseover effect overdoes it. Makes it look very messy.

Oh and when my browser loads up if you click the buttons straight away or if you click them really fast, they don't do the onmouseup event.

Anyway to fix this?

I got the on error code. The only thing I can think of is have a splash screen that shows while the browser load up but that'll only affect what happens when you click them as soon as the browser loads.
 
Code:
Private Sub Forums_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
On Error Resume Next
Forums.Visible = False
Wweb.Navigate ("http://www.ryanslair.com/BloodVulturesForums")
End Sub
Private Sub Forums_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Forums.Visible = True
End Sub

Okay I have that as my code for the onmousedown stuff.

Now, I have the image I want it to change to behind the image people see. This code works for all my buttons except for Forums. I click it and it hides itself but It doesn't come back when you lift your mouse button.

What the heck is wrong with it?

Anyone help me with this?
 
Make the image you want them to see on top of Forums and make its visible = false. Then add this code (edited to your needs):
Code:
Private Sub Forums_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
On Error Resume Next
Image.Visible = True
Wweb.Navigate ("http://www.ryanslair.com/BloodVulturesForums")
End Sub
Private Sub Forums_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Image.Visible = False
End Sub
 
Thanks!

I did some editing with the code and got it working. The onmouseup code had to have Private sub and the onmouseup image, not the normal one.

Now the main thing I need to know now is how to stop duplicate entries in the combobox.

Because if you type in http://www.sythe.org twice, It'll be added to the list both times.
 
Use this, edit it to your needs...
Code:
Private Sub Command1_Click()
Dim i As Integer
    For i = 0 To Combo1.ListCount - 1
        If Combo1.List(i) = "LOL" Then Exit Sub
    Next i
Combo1.AddItem "LOL"
End Sub
 
Runescape Gamblingrunescape gambling
Back
Top