Development Articles
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsOtherDevelopment Articles

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old August 4th, 2004, 11:13 AM
benoyraj benoyraj is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: US
Posts: 15 benoyraj User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Enabled/Disabled Internet control using vb6.0 and .NET

You have to do the following things to update automatically the forward/backward button using internet control.

Step 1: Declare constant variables
======================

Private Const CSC_NAVIGATEFORWARD As Integer = 1
Private Const CSC_NAVIGATEBACK As Integer = 2

Step 2: Write code on the Web Browser Command State Change Event
==============================================

For VB 6.0, write the following code:
=======================

Private Sub WebBrowser_CommandStateChange(ByVal Command As Long, ByVal Enable As Boolean)
' e.command identifies the effected button
Select Case Command
Case CSC_NAVIGATEBACK 'Back button
' Enable OR Disable the Back button
Mytoolbar.Buttons(1).Enabled = Enable
Case CSC_NAVIGATEFORWARD 'Forward button
' Enable OR Disable the Forward button
Mytoolbar.Buttons(2).Enabled = Enable
End Select

end Sub

For VB.NET, write the following code:
=======================

Private Sub WebBrowser_CommandStateChange(ByVal sender As Object, ByVal e As AxSHDocVw.DWebBrowserEvents2_CommandStateChangeEve nt) Handles WebBrowser.CommandStateChange

' e.command identifies the effected button
Select Case e.command
Case CSC_NAVIGATEBACK 'Back button
' Enable OR Disable the Back button
Mytoolbar.Buttons(2)..Enabled = e.enable
Case CSC_NAVIGATEFORWARD 'Forward button
' Enable OR Disable the Forward button
Mytoolbar.Buttons(2)..Enabled = e.enable
End Select

End Sub


Note: You can use command button as well. Then, you need to change the code shows below:

Button1.Enabled= enable (for VB6)
Button1.Enabled= e.enable(for VB.NET)


I hope this will solve your backward/forward button issues while using webBrowser control


Benoyraj B

Reply With Quote
Reply

Viewing: ASP Free ForumsOtherDevelopment Articles > Enabled/Disabled Internet control using vb6.0 and .NET


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT