如何使用VB.NET在IE中活动窗口的新选项卡中打开URL [英] How to open a URL in a new tab in the active window in IE using VB.NET

查看:77
本文介绍了如何使用VB.NET在IE中活动窗口的新选项卡中打开URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我有一个项目,我正在构建和点击事件我想导航到各种URL。

我正在使用Visual Studio 2013和加载项快速工具来创建IE的附加组件,其中包括一个带有Button和ContextMenuItem的工具栏,其中包含导航到各种URL的各种iteam的下拉列表。

但是当我点击这些项目时,它会在IE中打开一个新窗口而不是在同一个活动窗口中打开它。

有人可以帮助我在这里打开活动新标签中的URL窗口。

这是我现在写的代码。





Private Sub FBToolStripMenuItem_Click(发送者) As Object,e As EventArgs)处理FBToolStripMenuItem.Click

Dim objIE As SHDocVw.InternetExplorer

objIE = CreateObject(InternetExplorer.Application)

objIE.Visible = True

objIE.Navigate2(http://facebook.com/)

End Sub

Hi,

I have a project that i am building and for a click event i want to navigate to various URL's.
I am using Visual Studio 2013 and Add-in express tool to create the Add-on for IE, which includes a toolbar with a Button and ContextMenuItem contining drop down of various iteam navigating to various URL's.
But when i am clicking on the items it opens up a new window in IE rather that opening it up in the same active window.
Can someone help me here to open the URL in the new tab in the active window.
This is my Code that i have written for now.


Private Sub FBToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles FBToolStripMenuItem.Click
Dim objIE As SHDocVw.InternetExplorer
objIE = CreateObject("InternetExplorer.Application")
objIE.Visible = True
objIE.Navigate2("http://facebook.com/")
End Sub

推荐答案

你的代码甚至不像IE扩展应该是......

来自外部代码你无法强制IE在活动标签中打开新页面 - 这完全取决于用户如何配置IE,但是从扩展程序中你可以做更多的事情(记住你现在是IE的一部分)......

您可以从这里开始阅读: http://msdn.microsoft.com /en-us/library/aa753587(v=vs.85).aspx [ ^ ]
You code is not even resemble something an IE extension should be...
From external code you can not force IE to open new page in active tab - it totally depends on how the user configured IE, however from an extension you can do a lot more (remember you are part of IE now)...
You may start reading here: http://msdn.microsoft.com/en-us/library/aa753587(v=vs.85).aspx[^]


目前没有指令可以确定新页面是在标签页中打开还是一个新窗口。这是浏览器设置用户可配置的。



http://forums.asp.net/t/1902352.aspx?How+to+open+a+page+in+new+tab + in + javascript +或+ jquery + [ ^ ]
There is no current directives that determine whether the new page will open in a tab or a new window. This is browser setting user configurable.

http://forums.asp.net/t/1902352.aspx?How+to+open+a+page+in+new+tab+in+javascript+or+jquery+[^]


这篇关于如何使用VB.NET在IE中活动窗口的新选项卡中打开URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆