Click here to Skip to main content
16,020,565 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: NullReferenceException on Me.Invoke Pin
Dominick Marciano22-Aug-10 15:19
professionalDominick Marciano22-Aug-10 15:19 
QuestionConversion of BIFF7 to BIFF8 files Pin
Dominick Marciano22-Aug-10 10:58
professionalDominick Marciano22-Aug-10 10:58 
AnswerRe: Conversion of BIFF7 to BIFF8 files Pin
Luc Pattyn22-Aug-10 11:23
sitebuilderLuc Pattyn22-Aug-10 11:23 
GeneralRe: Conversion of BIFF7 to BIFF8 files Pin
Dominick Marciano22-Aug-10 12:31
professionalDominick Marciano22-Aug-10 12:31 
QuestionRe: Conversion of BIFF7 to BIFF8 files Pin
timslhsu14-Jan-11 20:43
timslhsu14-Jan-11 20:43 
QuestionHow do I get a custom context menu to show up??? Pin
thebiostyle22-Aug-10 9:26
thebiostyle22-Aug-10 9:26 
AnswerRe: How do I get a custom context menu to show up??? Pin
Luc Pattyn22-Aug-10 11:31
sitebuilderLuc Pattyn22-Aug-10 11:31 
AnswerRe: How do I get a custom context menu to show up??? Pin
Tom Foswick24-Aug-10 22:25
Tom Foswick24-Aug-10 22:25 
Hi,

It's pretty easy. You need to first make a ContextMenuStrip and add it to the form. It looks like you've already done this because you showed event handlers for items. I'm going to call that ContextMenuStrip "myContextMenuStrip". Clever, huh?

OK, the WebBrowser object has a ContextMenuStrip property. If you can set it at design time, then do that. Otherwise, you can add it to your dynamically-created WebBrowser object:

Dim Browser as New WebBrowser
Browser.ContextMenuStrip = myContextMenuStrip


This assumes you are making a Windows Forms app. I don't think the WebBrowser control for WPF has this property. There are options though.

As for the code to open in a new window or tab, that is a bit more complicated. You would think it would be easy, but it's not really straightforward. Here's why: The WebBrowser control is only a wrapper to a single IE window. Tabs in IE are handled by the application. Each tab contains its own WebBrowser control. (It doesn't actually use the WebBrowser control as such, but this illustrates the point.)

So, the WebBrowser control that you put on your form doesn't know anything about tabbed browsing or other windows. If you want that behavior, you need to create it manually. For example, if you want to open a link in a new tab, you need to:
1) Ascertain the URL
2) Create a new tab
3) Create a new WebBrowser instance and put it on that tab
4) Navigate the new WebBrowser to the URL

It looks like you understand steps 2-4. If you need help finding the URL of the link, let me know.

Opening in a link in a new window involves a similar process:
1) Ascertain the URL
2) Create a new window
3) Create a new WebBrowser instance and put it in that window
4) Navigate the new WebBrowser to the URL

Good luck.
GeneralRe: How do I get a custom context menu to show up??? Pin
thebiostyle25-Aug-10 9:41
thebiostyle25-Aug-10 9:41 
GeneralRe: How do I get a custom context menu to show up??? [modified] Pin
Tom Foswick25-Aug-10 9:56
Tom Foswick25-Aug-10 9:56 
GeneralRe: How do I get a custom context menu to show up??? Pin
thebiostyle28-Aug-10 13:33
thebiostyle28-Aug-10 13:33 
GeneralRe: How do I get a custom context menu to show up??? Pin
Tom Foswick30-Aug-10 5:51
Tom Foswick30-Aug-10 5:51 
GeneralRe: How do I get a custom context menu to show up??? Pin
thebiostyle30-Aug-10 13:36
thebiostyle30-Aug-10 13:36 
GeneralRe: How do I get a custom context menu to show up??? Pin
Tom Foswick30-Aug-10 14:30
Tom Foswick30-Aug-10 14:30 
GeneralRe: How do I get a custom context menu to show up??? [modified] Pin
thebiostyle4-Sep-10 7:29
thebiostyle4-Sep-10 7:29 
GeneralRe: How do I get a custom context menu to show up??? Pin
Tom Foswick4-Sep-10 7:50
Tom Foswick4-Sep-10 7:50 
GeneralRe: How do I get a custom context menu to show up??? Pin
thebiostyle4-Sep-10 7:53
thebiostyle4-Sep-10 7:53 
QuestionAn easy way to archive many files into one file? [Solved] Pin
Pamodh22-Aug-10 6:28
Pamodh22-Aug-10 6:28 
AnswerRe: An easy way to archive many files into one file? Pin
Eddy Vluggen22-Aug-10 9:57
professionalEddy Vluggen22-Aug-10 9:57 
GeneralRe: An easy way to archive many files into one file? Pin
Pamodh23-Aug-10 5:34
Pamodh23-Aug-10 5:34 
GeneralRe: An easy way to archive many files into one file? Pin
Eddy Vluggen23-Aug-10 9:40
professionalEddy Vluggen23-Aug-10 9:40 
GeneralRe: An easy way to archive many files into one file? Pin
Pamodh24-Aug-10 1:47
Pamodh24-Aug-10 1:47 
QuestionProblem in saving image to database from picturebox. VB.Net 2008. Framework 3.5. Pin
priyamtheone20-Aug-10 3:23
priyamtheone20-Aug-10 3:23 
AnswerRe: Problem in saving image to database from picturebox. VB.Net 2008. Framework 3.5. Pin
Luc Pattyn20-Aug-10 3:42
sitebuilderLuc Pattyn20-Aug-10 3:42 
QuestionRe: Problem in saving image to database from picturebox. VB.Net 2008. Framework 3.5. Pin
priyamtheone21-Aug-10 2:30
priyamtheone21-Aug-10 2:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.