Print Page | Close Window

Another question web browser control

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Controls
Forum Description: Topics Related to Codejock Controls
URL: http://forum.codejock.com/forum_posts.asp?TID=13523
Printed Date: 09 May 2024 at 11:22pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Another question web browser control
Posted By: shipwreck
Subject: Another question web browser control
Date Posted: 28 February 2009 at 9:02am
Alright, since noone has an idea of how to display custom multiple context menu's within the web browser control. So, I have a question about the default menu provided inside the web browser control.


See how "Open in new tab" is disabled? That's the problem.
How can I get this enabled, and to have it open a new tab in my application just like internet explorer would perform?




-------------
Product: Xtreme Suite Pro (Active-X), Version 15.3.1

Platform: Windows 7 Ultimate SP1 (64Bit) & Windows XP Mode SP3 (32Bit)

Language: Visual Basic 6.0 SP6



Replies:
Posted By: dentor
Date Posted: 28 February 2009 at 10:44am
Hello Shipwreck,
 
To open the new web page in a new tab as internet explorer do, you must set (load) a new web browser control and open the new url in it:
    WB(2).Navigate NewUrl
 
If you want to prevent the actual web page to open in a new web page (will be open in internet explorer, if you don't prevent it), you can write:
 
Private Sub WB_NewWindow2(ppDisp As Object, Cancel As Boolean)
    Cancel = True
    WB.Navigate NewUrl
End Sub

to force the web page to open in the actual web control.
 
********************************************
Displaying multiple context menus seems to be a more complicated subject, I haven't explore yet.
 
I can perhap's give you a direction:
 
Add of course, a reference to Microsoft HTML Object Library
 
Place in the declaration section,
 
Private WithEvents Doc As HTMLDocument
 
' *** To set web document
Private Sub WB_DocumentComplete(ByVal pDisp As Object, URL As Variant)
  If (pDisp Is WB.Object) Then
         Set Doc = WB.document
  End If
End Sub
 
' *** To test right clic
Private Sub Doc_onmousedown()
Dim Elem As IHTMLElement
  Set Elem = Doc.parentWindow.event.srcElement
  With Elem
      If Doc.parentWindow.event.button = 2 Then
          Dim msg As String
          Select Case UCase$(.tagName)
          Case "A"
            ' HREF
          Case "IMG"
            ' IMG
          End Select
      End If
  End With
End Sub
 
Hope you can explore further.
 


Posted By: shipwreck
Date Posted: 28 February 2009 at 11:00am
Hey there Dentor.  I suppose you don't really understand my question in this topic, but I appreciate all that further info you provided.
What I mean in this post is that I know how to make new windows popup considerably, but I wanted to enable the Context Menu Item "Open in New Tab" so that I could use it just like the actual IE does. Get what I'm saying?


-------------
Product: Xtreme Suite Pro (Active-X), Version 15.3.1

Platform: Windows 7 Ultimate SP1 (64Bit) & Windows XP Mode SP3 (32Bit)

Language: Visual Basic 6.0 SP6


Posted By: dentor
Date Posted: 28 February 2009 at 11:45am
Ok I see.
 
For me the menu 'Open in new tab' is enabled.
Have you the same menu disabled in Internet Explorer or just in Web Control?
 
 
 


Posted By: shipwreck
Date Posted: 28 February 2009 at 1:28pm
Just in the web browser control.
If I open Internet Explorer, the menu item is enabled and works perfectly.
But in the codejock web browser control, it is disabled.


-------------
Product: Xtreme Suite Pro (Active-X), Version 15.3.1

Platform: Windows 7 Ultimate SP1 (64Bit) & Windows XP Mode SP3 (32Bit)

Language: Visual Basic 6.0 SP6


Posted By: shipwreck
Date Posted: 28 February 2009 at 8:47pm
Hello?.. Lol.
Anyone out there?



-------------
Product: Xtreme Suite Pro (Active-X), Version 15.3.1

Platform: Windows 7 Ultimate SP1 (64Bit) & Windows XP Mode SP3 (32Bit)

Language: Visual Basic 6.0 SP6


Posted By: dlederman
Date Posted: 20 November 2009 at 5:43pm
I had the same problem, although not using XTP's browser control, and found a solution.... thought I'd post it here.

Calling CoInternetSetFeatureEnabled() with FEATURE_TABBED_BROWSING will enable tabbed browsing for either the entire process or the calling thread, depending on a separate parameter that you specify.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net