whats up everyone, ok my problem is the back and forward buttons in a browser im developing within Visual Basic
ok so i know the
backbutton.GoBack
forwardbutton.GoForward
and they work, but only if the browser has something to go forward or back to...
so as you can see i get an error when i run my project and hit either button as the first thing i do.
error
so i fix that by disabling the buttons at form load and enable the back button when a i click the go button, and enable the forward button when i click the back button....
well the main issue is, how can i keep the back button from trying to go back to something that isnt there, when its "run out of pages to go back to or forwards to"
ive tried a few different IF Then statements but they didnt do the job
any ideas?
back button and forward button issue
- CommonStray
- Forum Assassin
- Posts: 1215
- Joined: 20 Aug 2005, 16:00
- 19
- bad_brain
- Site Owner
- Posts: 11638
- Joined: 06 Apr 2005, 16:00
- 19
- Location: In your eye floaters.
- Contact:
Um, well...I don´t know much about VB, but I guess (because it´s OOP) there is surely a method which handles exeptions, in Java it´s the catch-method, here´s how a mathematical exeption can be handled (a division by 0 for example):
Hope it helped a bit...
Code: Select all
catch (ArithmeticExeption exc) {
System.out.println("Division by 0 not allowed!");
}
- CommonStray
- Forum Assassin
- Posts: 1215
- Joined: 20 Aug 2005, 16:00
- 19
ok i figured out a way to keep it from creating an error
On Error Resume Next
If cwbr.CausesValidation = False Then
Call cantgoback
back_butt.Enabled = False
Else
cbwbTimer.Enabled = True
'Tells Browser to go back a page
cwbr.GoBack
End If
it just makes it so its non functional when trying to go back, good for now
On Error Resume Next
If cwbr.CausesValidation = False Then
Call cantgoback
back_butt.Enabled = False
Else
cbwbTimer.Enabled = True
'Tells Browser to go back a page
cwbr.GoBack
End If
it just makes it so its non functional when trying to go back, good for now