8 Replies - 2564 Views - Last Post: 01 December 2010 - 10:56 AM Rate Topic: -----

#1 samforever1989  Icon User is offline

  • D.I.C Head

Reputation: -6
  • View blog
  • Posts: 53
  • Joined: 25-November 10

open link in tab using or window using contextMenuStrip

Posted 30 November 2010 - 10:36 AM

Is it really possible that we right click a link and choose to open link in tab using ContextMenuStrip and the link opens in tab... I have searched lot but nothing worked .
I even went to microsoft site even it could not give me the exact solution of the problem..

in some code the Microsoft Internet explorer's default context menu occur and in some other code the page opens in Internet Explorer itself rather than opening in my own browser..

Is This A Good Question/Topic? 0
  • +

Replies To: open link in tab using or window using contextMenuStrip

#2 Sergio Tapia  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1252
  • View blog
  • Posts: 4,168
  • Joined: 27-January 10

Re: open link in tab using or window using contextMenuStrip

Posted 30 November 2010 - 10:49 AM

Can you post code that opens in your browser, and code that opens in Internet Explorer? Post them between CODE tags.
Was This Post Helpful? 0
  • +
  • -

#3 samforever1989  Icon User is offline

  • D.I.C Head

Reputation: -6
  • View blog
  • Posts: 53
  • Joined: 25-November 10

Re: open link in tab using or window using contextMenuStrip

Posted 30 November 2010 - 11:39 AM

and this time I am honestly telling this is copied code...
because as I told I am beginner in .Net so please try to understand... bro...


 private void addNewTab()
        {
            TabPage tpage = new TabPage();
            tpage.BorderStyle = BorderStyle.Fixed3D;
            browserTabControl.TabPages.Insert(browserTabControl.TabCount - 1, tpage);
            WebBrowser browser = new WebBrowser();
            browser.Navigate(homePage);   
            tpage.Controls.Add(browser);
            browser.Dock = DockStyle.Fill;
            browserTabControl.SelectTab(tpage);
            browser.ProgressChanged += new WebBrowserProgressChangedEventHandler(Form1_ProgressChanged);
            browser.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(Form1_DocumentCompleted);
            browser.Navigating += new WebBrowserNavigatingEventHandler(Form1_Navigating);
            browser.CanGoBackChanged += new EventHandler(browser_CanGoBackChanged);
            browser.CanGoForwardChanged += new EventHandler(browser_CanGoForwardChanged);
           
        }



Was This Post Helpful? 0
  • +
  • -

#4 tlhIn`toq  Icon User is online

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5436
  • View blog
  • Posts: 11,662
  • Joined: 02-June 10

Re: open link in tab using or window using contextMenuStrip

Posted 30 November 2010 - 11:44 AM

You seem to have a working AddNewTab method in your web browser since you just posted it.

What exactly is the problem? Your only question was "is it possible". The answer is 'yes' and it looks like you've already done it.
Was This Post Helpful? 0
  • +
  • -

#5 Sergio Tapia  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1252
  • View blog
  • Posts: 4,168
  • Joined: 27-January 10

Re: open link in tab using or window using contextMenuStrip

Posted 30 November 2010 - 11:45 AM

Quote

in some code the Microsoft Internet explorer's default context menu occur and in some other code the page opens in Internet Explorer itself rather than opening in my own browser..


What code is executed when it open correctly in your browser?

What code is executed when it opens in Internet Explorer?

We need to compare and contrast those two code bundles. Or is it the same code but different websites that cause this issue?
Was This Post Helpful? 0
  • +
  • -

#6 tlhIn`toq  Icon User is online

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5436
  • View blog
  • Posts: 11,662
  • Joined: 02-June 10

Re: open link in tab using or window using contextMenuStrip

Posted 30 November 2010 - 12:40 PM

View PostSergio Tapia, on 30 November 2010 - 10:45 AM, said:

Quote

in some code the Microsoft Internet explorer's default context menu occur and in some other code the page opens in Internet Explorer itself rather than opening in my own browser..


What code is executed when it open correctly in your browser?

What code is executed when it opens in Internet Explorer?

We need to compare and contrast those two code bundles. Or is it the same code but different websites that cause this issue?


Sergio: I think you're missing the point. This is not about Internet Exploder. The OP is creating their own browser. They want to right-click a link and have it open in a new tab *in the browser they are building*. You can see this by looking at the AddNewTab() method the OP posted.

The part I'm confused about is what the actual problem the OP is running in to. They seem to have a working method for adding a new tab. So beyond their question of "is it possible", there is no indication of the action problem is.
Was This Post Helpful? 0
  • +
  • -

#7 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6039
  • View blog
  • Posts: 23,436
  • Joined: 23-August 08

Re: open link in tab using or window using contextMenuStrip

Posted 30 November 2010 - 01:06 PM

I'm pretty sure the issue here is that this person has no idea how to program outside of copying and pasting code he finds on the Internet. Therefore, he FOUND some code to add a new tab, but doesn't know how to INTEGRATE that code into the application.

Just a wild-ass guess based on the OP's history. Classic help vampirism, as noted in the previous, now closed, topic.
Was This Post Helpful? 0
  • +
  • -

#8 samforever1989  Icon User is offline

  • D.I.C Head

Reputation: -6
  • View blog
  • Posts: 53
  • Joined: 25-November 10

Re: open link in tab using or window using contextMenuStrip

Posted 01 December 2010 - 02:06 AM

View PostSergio Tapia, on 30 November 2010 - 10:45 AM, said:

Quote

in some code the Microsoft Internet explorer's default context menu occur and in some other code the page opens in Internet Explorer itself rather than opening in my own browser..


What code is executed when it open correctly in your browser?

What code is executed when it opens in Internet Explorer?

We need to compare and contrast those two code bundles. Or is it the same code but different websites that cause this issue?


ok firstly tell me is it possible that I right click within my browser's webpage (even on link of this webpage) and my defined ContextMenuStrip occur (while my browser is running)..??

If yes then how because... which code I have opens context menu of Internet Explorer...
Was This Post Helpful? 0
  • +
  • -

#9 tlhIn`toq  Icon User is online

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5436
  • View blog
  • Posts: 11,662
  • Joined: 02-June 10

Re: open link in tab using or window using contextMenuStrip

Posted 01 December 2010 - 10:56 AM

View Postsamforever1989, on 01 December 2010 - 01:06 AM, said:

View PostSergio Tapia, on 30 November 2010 - 10:45 AM, said:

Quote

in some code the Microsoft Internet explorer's default context menu occur and in some other code the page opens in Internet Explorer itself rather than opening in my own browser..


What code is executed when it open correctly in your browser?

What code is executed when it opens in Internet Explorer?

We need to compare and contrast those two code bundles. Or is it the same code but different websites that cause this issue?


ok firstly tell me is it possible that I right click within my browser's webpage (even on link of this webpage) and my defined ContextMenuStrip occur (while my browser is running)..??

If yes then how because... which code I have opens context menu of Internet Explorer...


That makes sense because the .NET webbrowser control basically *is* an Internet Explorer window. The context menu of Internet Explorer includes "Open in new tab"

May I suggest a book that walks you through building your own web browser? You can try to figure it all out yourself (re-inventing the wheel) or you can learn from a proper how-to lesson.
Build a Program Now! in Visual C# by Microsoft Press, ISBN 0-7356-2542-5
is a terrific book that has you build a Windows Forms application, a WPF app, a database application, your own web browser.

You'll notice that the WebBrowser control has a property of "IsWebBrowserContextMenuEnabled" which is set to true by default. That is where you are getting the set of I.E. context menu options from.

If you set "IsWebBrowserContextMenuEnabled" to false, you can then build your own ContextMenu.
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1