[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 412
  • Last Modified:

Getting WebBrowser controls history

Hi,

Im using a WebBrowser control within VB6...I have back and forward buttons just like in IE..however, i want to disable the back, or forward buttons within the menu if the WebBrowsers history is empty...in javascript it is obviously history.length ....is there anyway i can either return this value to my vb app, or use my own VB call to get the windows history????

Also, anyone any idea how to disable an item in a VB 6 menu, i dont see that the menu has any object name i can refer to???

Thanks

al
0
higgsy
Asked:
higgsy
  • 6
  • 3
1 Solution
 
Erick37Commented:
From MS:

"The WebBrowser control supports a CommandStateChange event, which is fired whenever the Forward or Back buttons need to be enabled or disabled. "

http://support.microsoft.com/default.aspx?scid=kb;EN-US;163282

' A Visual Basic application can also implement this
' functionality in this manner:  

Private Sub WebBrowser_CommandStateChange(ByVal Command As Long,ByVal Enable As Boolean)

       Select Case Command
           Case CSC_NAVIGATEBACK
               Back.Enabled = Enable
           Case CSC_NAVIGATEFORWARD
               Forward.Enabled = Enable
       End Select

End Sub
0
 
Erick37Commented:
oops...

Here are the constants:

Private Const CSC_NAVIGATEFORWARD As Long = 1
Private Const CSC_NAVIGATEBACK As Long = 2
0
 
higgsyAuthor Commented:
Hi Erick,

That seems to work great, however what does Back.Enabled and Forward.Enabled refer to .... i just ran this code and it crashes due to the fact that there are no objects called Back or Forward in my App...

Should this refer to the menu item name??
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
higgsyAuthor Commented:
Hi Erick,

Ive tried changing it o the name of my menu item and it works great....thanks...

Do u know how to add an icon into any menu item???
0
 
Erick37Commented:
Right, replace Back.Enabled to [the name of your back button].enabled

>>Do u know how to add an icon into any menu item???
Some links for you:
http://www.ilook.fsnet.co.uk/vb/vbmnicon.htm
http://www.thescarms.com/vbasic/ClearForm.asp
0
 
Erick37Commented:
And another good one which uses an ImageList control to store the bitmaps:

http://www.freevbcode.com/ShowCode.asp?ID=6533
0
 
higgsyAuthor Commented:
Top stuff Erick....

Thanks mate
0
 
Erick37Commented:
You're welcome, glad it worked out for you.
0
 
Erick37Commented:
Looking forward to an "A" when you get the chance.

Thanks!
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 6
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now