473,385 Members | 1,279 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Interesting IntelliSense behaviour with Webbrowser

Hi there,
I needed to use MouseOver event on Webbrowser which is NOT provided by
webbrowser control natively(what a disappointment), so i decided to go
with another route to simulate this like:
////////////////////////////////////////////////
Public Sub DisplayHyperlinks(ByVal sender As Object, ByVal e As
System.Windows.Forms.HtmlElementEventArgs)

' My codes here

End Sub

Private Sub webbrowser1_DocumentCompleted(ByVal sender As
System.Object, ByVal e As
System.Windows.Forms.WebBrowserDocumentCompletedEv entArgs) Handles
webbrowser1.DocumentCompleted

' Here is my question
' Although intellisense doesn't recognize "Document", but i'm still
able to compile
' and use this addhandler syntax without any build or runtime errors
AddHandler webbrowser1.Document.MouseOver, AddressOf
Me.DisplayHyperlinks

End Sub
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

Shortly:
"AddHandler webbrowser1.Document.MouseOver, AddressOf
Me.DisplayHyperlinks"

...that syntax claims no error when it's built / compiled, but
IntelliSense doesn't recognize "Document" after "webbrowser1" object.

Why?

I hope i have explained enoug clear,
Thanks,

Onur Güzel
Jul 7 '08 #1
11 2183

"kimiraikkonen" <ki*************@gmail.comwrote in message
news:2f**********************************@m44g2000 hsc.googlegroups.com...
Hi there,
I needed to use MouseOver event on Webbrowser which is NOT provided by
webbrowser control natively(what a disappointment), so i decided to go
with another route to simulate this like:
////////////////////////////////////////////////
Public Sub DisplayHyperlinks(ByVal sender As Object, ByVal e As
System.Windows.Forms.HtmlElementEventArgs)

' My codes here

End Sub

Private Sub webbrowser1_DocumentCompleted(ByVal sender As
System.Object, ByVal e As
System.Windows.Forms.WebBrowserDocumentCompletedEv entArgs) Handles
webbrowser1.DocumentCompleted

' Here is my question
' Although intellisense doesn't recognize "Document", but i'm still
able to compile
' and use this addhandler syntax without any build or runtime errors
AddHandler webbrowser1.Document.MouseOver, AddressOf
Me.DisplayHyperlinks

End Sub
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

Shortly:
"AddHandler webbrowser1.Document.MouseOver, AddressOf
Me.DisplayHyperlinks"

....that syntax claims no error when it's built / compiled, but
IntelliSense doesn't recognize "Document" after "webbrowser1" object.

Why?

I hope i have explained enoug clear,
Thanks,

Onur Güzel

What are you trying to get. If you are trying to get a link when the mouse
is over one on a page you can use the StatusTextChanged event to get links.

LS

Jul 7 '08 #2
kimiraikkonen wrote:
Shortly:
"AddHandler webbrowser1.Document.MouseOver, AddressOf
Me.DisplayHyperlinks"

...that syntax claims no error when it's built / compiled, but
IntelliSense doesn't recognize "Document" after "webbrowser1" object.

Why?
It does on my machine. Me.WebBrowser1.Document comes right up. Something else
not compiling correctly?
Jul 8 '08 #3
>
What are you trying to get. If you are trying to get a link when the mouse
is over one on a page you can use the StatusTextChanged event to get links.

LS
Yes, but that doesn't provide when mouse is over an image which is my
goal about retrieving image location.

However, i did it using "AddHandler webbrowser1.Document.MouseOver,
AddressOf Me.DisplayHyperlinks" but my question and wonder was just
about why Intellisense doesn't offer "Document" after webbrowser1
while you're typing syntax manually instead of pasting from
somewhere,you can test it. Though IntelliSense doesn't offer and
recognize "Document" after "webbrowser1" object, if i type it without
addhandler keyword just to use its members somewhere else it sees
"Document" member of "webbrowser1" object with no problem, but as i
said if paste the code without manually typing, there are no errors
reported even on building my application.

That's weird of IntelliSense.

Thanks,

Onur
Jul 8 '08 #4
kimiraikkonen wrote:
somewhere,you can test it. Though IntelliSense doesn't offer and
recognize "Document" after "webbrowser1" object, if i type it without
addhandler keyword just to use its members somewhere else it sees
"Document" member of "webbrowser1" object with no problem,
Ah, you mean it doesn't show Document after AddHandler.

No, it wouldn't. It will filter the list of WebBrowser members to show events
that can have a handler added.

You can get intellisense for the list of Document events by declaring a temp
variable first:
Dim x As HtmlDocument = WebBrowser1.Document
AddHandler x.MouseOver, AddressOf Me.DisplayHyperlinks
Jul 8 '08 #5
Hi Steve,
Yes, if i use this syntax, intellisense recognizes every object with no
problem.
Dim x As HtmlDocument = WebBrowser1.Document
AddHandler x.MouseOver, AddressOf Me.DisplayHyperlinks
But if i use in this way, it doesn't show "Document" property just after
"Webbrowser1"(it's impatient that it expects an event), though that code is
compiled and it works as it should:

AddHandler kimibrowser.Document.MouseOver, AddressOf Me.DisplayHyperlinks

Thanks for the care,

Onur Güzel
--
Best regards,

Onur Güzel
ki*************@hotmail.com
"Steve Gerrard" wrote:
kimiraikkonen wrote:
Shortly:
"AddHandler webbrowser1.Document.MouseOver, AddressOf
Me.DisplayHyperlinks"

...that syntax claims no error when it's built / compiled, but
IntelliSense doesn't recognize "Document" after "webbrowser1" object.

Why?

It does on my machine. Me.WebBrowser1.Document comes right up. Something else
not compiling correctly?
Jul 8 '08 #6
Yeah, a straight code like:

Me.Webbrowser1.Document... has also no recognition problem by Intellisense
on my machine,too.

The problem with Intellisense was the syntax i was using:
AddHandler webbrowser1.Document.MouseOver, AddressOf Me.DisplayHyperlinks
Thanks,

Onur Güzel

--
Best regards,

Onur Güzel
ki*************@hotmail.com
"Steve Gerrard" wrote:
kimiraikkonen wrote:
Shortly:
"AddHandler webbrowser1.Document.MouseOver, AddressOf
Me.DisplayHyperlinks"

...that syntax claims no error when it's built / compiled, but
IntelliSense doesn't recognize "Document" after "webbrowser1" object.

Why?

It does on my machine. Me.WebBrowser1.Document comes right up. Something else
not compiling correctly?
Jul 8 '08 #7

"kimiraikkonen" <ki*************@gmail.comwrote in message
news:2f**********************************@m44g2000 hsc.googlegroups.com...
Hi there,
I needed to use MouseOver event on Webbrowser which is NOT provided by
webbrowser control natively(what a disappointment), so i decided to go
with another route to simulate this like:
////////////////////////////////////////////////
Public Sub DisplayHyperlinks(ByVal sender As Object, ByVal e As
System.Windows.Forms.HtmlElementEventArgs)

' My codes here

End Sub

Private Sub webbrowser1_DocumentCompleted(ByVal sender As
System.Object, ByVal e As
System.Windows.Forms.WebBrowserDocumentCompletedEv entArgs) Handles
webbrowser1.DocumentCompleted

' Here is my question
' Although intellisense doesn't recognize "Document", but i'm still
able to compile
' and use this addhandler syntax without any build or runtime errors
AddHandler webbrowser1.Document.MouseOver, AddressOf
Me.DisplayHyperlinks

End Sub
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

Shortly:
"AddHandler webbrowser1.Document.MouseOver, AddressOf
Me.DisplayHyperlinks"

....that syntax claims no error when it's built / compiled, but
IntelliSense doesn't recognize "Document" after "webbrowser1" object.

Why?

I hope i have explained enoug clear,
Thanks,

Onur Güzel

Finally got a chance to test this and I do not see the problem you describe.

The app I used to test is one that takes a list of URL's and in a tabcontrol
, creates a new tabpage, a new WebBrowser, and then adds the WebBrowser to
the tabpage and the tabpage to the tabcontrol.

My code is (for the webbrowser) is just

Dim wc As New WebBrowser

Now when I type

AddHandler wc. (now I get document) . and I get a list of not just events
but properties and functions as well.

I can select MouseOver from the list and all is good.

I am using VS 2008 Pro.

LS

Jul 8 '08 #8
Hi Lloyd,
I'm using VB 2005 express and i placed Webbrowser control from toolbox into
my form, and it doesn't recognize Document property if i use it in a
"Addhandler" syntax.

Addhandler webbrowser.<i don't get Document, it expects an event as
well>.MouseOver,AddressOf Me.DisplayHyperlinks

As you're using VS 2008, maybe that may have been fixed in 2008 or you need
to place Webbrowser control to your form instead of manually creating
WebBrowser instance.

And of course when i use Webbrowser1 object elsewhere like in a sub or in a
button1.click event there's no problem with intellisense

Webbrowser1.Document.members...... (no problem)

The problem was recognizing Document property of Webbrowser within Addhandler.

Plus, Steve's suggestion worked to make Webbrowser recognize all the objects:
Dim x As HtmlDocument = WebBrowser1.Document
AddHandler x.MouseOver, AddressOf Me.DisplayHyperlinks

Thanks,

Onur
--
Best regards,

Onur Güzel
ki*************@hotmail.com
"Lloyd Sheen" wrote:
>
"kimiraikkonen" <ki*************@gmail.comwrote in message
news:2f**********************************@m44g2000 hsc.googlegroups.com...
Hi there,
I needed to use MouseOver event on Webbrowser which is NOT provided by
webbrowser control natively(what a disappointment), so i decided to go
with another route to simulate this like:
////////////////////////////////////////////////
Public Sub DisplayHyperlinks(ByVal sender As Object, ByVal e As
System.Windows.Forms.HtmlElementEventArgs)

' My codes here

End Sub

Private Sub webbrowser1_DocumentCompleted(ByVal sender As
System.Object, ByVal e As
System.Windows.Forms.WebBrowserDocumentCompletedEv entArgs) Handles
webbrowser1.DocumentCompleted

' Here is my question
' Although intellisense doesn't recognize "Document", but i'm still
able to compile
' and use this addhandler syntax without any build or runtime errors
AddHandler webbrowser1.Document.MouseOver, AddressOf
Me.DisplayHyperlinks

End Sub
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

Shortly:
"AddHandler webbrowser1.Document.MouseOver, AddressOf
Me.DisplayHyperlinks"

....that syntax claims no error when it's built / compiled, but
IntelliSense doesn't recognize "Document" after "webbrowser1" object.

Why?

I hope i have explained enoug clear,
Thanks,

Onur Güzel

Finally got a chance to test this and I do not see the problem you describe.

The app I used to test is one that takes a list of URL's and in a tabcontrol
, creates a new tabpage, a new WebBrowser, and then adds the WebBrowser to
the tabpage and the tabpage to the tabcontrol.

My code is (for the webbrowser) is just

Dim wc As New WebBrowser

Now when I type

AddHandler wc. (now I get document) . and I get a list of not just events
but properties and functions as well.

I can select MouseOver from the list and all is good.

I am using VS 2008 Pro.

LS

Jul 8 '08 #9

"kimiraikkonen" <ki***********@discussions.microsoft.comwrote in message
news:4B**********************************@microsof t.com...
Hi Lloyd,
I'm using VB 2005 express and i placed Webbrowser control from toolbox
into
my form, and it doesn't recognize Document property if i use it in a
"Addhandler" syntax.

Addhandler webbrowser.<i don't get Document, it expects an event as
well>.MouseOver,AddressOf Me.DisplayHyperlinks

As you're using VS 2008, maybe that may have been fixed in 2008 or you
need
to place Webbrowser control to your form instead of manually creating
WebBrowser instance.

And of course when i use Webbrowser1 object elsewhere like in a sub or in
a
button1.click event there's no problem with intellisense

Webbrowser1.Document.members...... (no problem)

The problem was recognizing Document property of Webbrowser within
Addhandler.

Plus, Steve's suggestion worked to make Webbrowser recognize all the
objects:
Dim x As HtmlDocument = WebBrowser1.Document
AddHandler x.MouseOver, AddressOf Me.DisplayHyperlinks

Thanks,

Onur
--
Best regards,

Onur Güzel
ki*************@hotmail.com
"Lloyd Sheen" wrote:
>>
"kimiraikkonen" <ki*************@gmail.comwrote in message
news:2f**********************************@m44g200 0hsc.googlegroups.com...
Hi there,
I needed to use MouseOver event on Webbrowser which is NOT provided by
webbrowser control natively(what a disappointment), so i decided to go
with another route to simulate this like:
////////////////////////////////////////////////
Public Sub DisplayHyperlinks(ByVal sender As Object, ByVal e As
System.Windows.Forms.HtmlElementEventArgs)

' My codes here

End Sub

Private Sub webbrowser1_DocumentCompleted(ByVal sender As
System.Object, ByVal e As
System.Windows.Forms.WebBrowserDocumentCompletedE ventArgs) Handles
webbrowser1.DocumentCompleted

' Here is my question
' Although intellisense doesn't recognize "Document", but i'm still
able to compile
' and use this addhandler syntax without any build or runtime errors
AddHandler webbrowser1.Document.MouseOver, AddressOf
Me.DisplayHyperlinks

End Sub
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

Shortly:
"AddHandler webbrowser1.Document.MouseOver, AddressOf
Me.DisplayHyperlinks"

....that syntax claims no error when it's built / compiled, but
IntelliSense doesn't recognize "Document" after "webbrowser1" object.

Why?

I hope i have explained enoug clear,
Thanks,

Onur Güzel

Finally got a chance to test this and I do not see the problem you
describe.

The app I used to test is one that takes a list of URL's and in a
tabcontrol
, creates a new tabpage, a new WebBrowser, and then adds the WebBrowser
to
the tabpage and the tabpage to the tabcontrol.

My code is (for the webbrowser) is just

Dim wc As New WebBrowser

Now when I type

AddHandler wc. (now I get document) . and I get a list of not just
events
but properties and functions as well.

I can select MouseOver from the list and all is good.

I am using VS 2008 Pro.

LS

I changed my project for a test by adding a webbrowser to the form. I can
still use the addHandler to get the intellisense that is correct and
includes MouseOver. Again I am using VS 2008 so I don't know if that is the
difference.

I don't have any extra references or anything out of the ordinary.

LS

Jul 9 '08 #10
kimiraikkonen wrote:
>What are you trying to get. If you are trying to get a link when the mouse
is over one on a page you can use the StatusTextChanged event to get links.

LS

Yes, but that doesn't provide when mouse is over an image which is my
goal about retrieving image location.

However, i did it using "AddHandler webbrowser1.Document.MouseOver,
AddressOf Me.DisplayHyperlinks" but my question and wonder was just
about why Intellisense doesn't offer "Document" after webbrowser1
while you're typing syntax manually instead of pasting from
somewhere,you can test it. Though IntelliSense doesn't offer and
recognize "Document" after "webbrowser1" object, if i type it without
addhandler keyword just to use its members somewhere else it sees
"Document" member of "webbrowser1" object with no problem, but as i
said if paste the code without manually typing, there are no errors
reported even on building my application.

That's weird of IntelliSense.

Thanks,

Onur
Could it be that your reference link to the MSHTML library is corrupted?
** Posted from http://www.teranews.com **
Jul 9 '08 #11
On Jul 8, 4:16 pm, "Mr. Clean" <mrclean@p&G.comwrote:
kimiraikkonen wrote:
What are you trying to get. If you are trying to get a link when the mouse
is over one on a page you can use the StatusTextChanged event to get links.
LS
Yes, but that doesn't provide when mouse is over an image which is my
goal about retrieving image location.
However, i did it using "AddHandler webbrowser1.Document.MouseOver,
AddressOf Me.DisplayHyperlinks" but my question and wonder was just
about why Intellisense doesn't offer "Document" after webbrowser1
while you're typing syntax manually instead of pasting from
somewhere,you can test it. Though IntelliSense doesn't offer and
recognize "Document" after "webbrowser1" object, if i type it without
addhandler keyword just to use its members somewhere else it sees
"Document" member of "webbrowser1" object with no problem, but as i
said if paste the code without manually typing, there are no errors
reported even on building my application.
That's weird of IntelliSense.
Thanks,
Onur

Could it be that your reference link to the MSHTML library is corrupted?
** Posted fromhttp://www.teranews.com**
It doesn't seem any reference to MSHTML library, i use Webbrowser
control.

However, as i stated, pasting the whole code claims no error even on
compiling about "Document" when it's used with Addhandler, and just
IntelliSense doesn't recognize Document after Addhandler
webbrowser.Document...., except Steve's workaround that is described
in previous posts which is worked.

Thanks,

Onur Güzel
Jul 9 '08 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Peter van der Goes | last post by:
When a struct is created in C# and a parameterized constructor defined, the IntelliSense editor shows only the syntax for the parameterized constructor in tooltips, but not for the default...
6
by: Stefan Kronberg | last post by:
I'm working on a solution containing about 20 projects. Some of the projects contain class definitions that are used in other of the projects. Most of the time intellisense is working ok, i.e. if I...
0
by: Babu Mannaravalappil | last post by:
(This is a cut-and-paste) of one of my previous posts. Since I did not get any help, I thought may be I should re-post it anew. Sorry!!) Environment: Visual Studio Enterprise 2003 DotNET 1.1...
10
by: Rakesh Rajan | last post by:
Hi, Seems like VB.NET Intellisense and complier does check for method definitions much. The following code compiles with no errors in VB.NET! (but of course, trust C# to be strict and perfect :)...
2
by: Marco | last post by:
Why c# intellisense is more powerful than c++ intellisense? In c# when type a character intellisense start and guide me.In c++ intellisense start only when I type a . or -> or ::. In c# user class...
12
by: Peteroid | last post by:
I was creating my application just fine for the last 3 weeks or so. Then, starting this morning, IntelliSense seems to be having problems. It goes into a locked 'Updating IntelliSense..." mode....
1
by: =?Utf-8?B?Sm9iIExvdA==?= | last post by:
i am creating a formula editor and would like to provide intellisense feature to the textbox in formula editor. does any one know how can i do that? thanks
28
by: v4vijayakumar | last post by:
#include <string> #include <iostream> using namespace std; int main() { string str; str.resize(5); str = 't';
7
by: Clive Dixon | last post by:
Sometimes when I'm typing the literal 'null', Intellisense decides to automatically change it to 'Nullable'. Is there any way anyone knows of stopping it doing this, apart from disabling...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.