Webbrowser有趣的IntelliSense行为 [英] Interesting IntelliSense behaviour with Webbrowser

查看:54
本文介绍了Webbrowser有趣的IntelliSense行为的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我需要在Webbrowser上使用MouseOver事件,这不是由

webbrowser控件本身提供的(多么令人失望),所以我决定去

用另一条模拟这个的路线:

/////////////////////////// /////////////////////

Public Sub DisplayHyperlinks(ByVal sender As Object,ByVal e As

System .Windows.Forms.HtmlElementEventArgs)


''我的代码在这里


结束子


Private Sub webbrowser1_DocumentCompleted(ByVal sender As

System.Object,ByVal e As

System.Windows.Forms.WebBrowserDocumentCompletedEv entArgs)句柄

webbrowser1。 DocumentCompleted


''这是我的问题

''虽然intellisense不认识文件,但我仍然是

能够编译

''并使用这个addhandler语法,没有任何构建或运行时错误

AddHandler webbrowser1.Document.MouseOver,AddressOf

Me.DisplayHyperlinks


End Sub

\\\\\ \\\\\\\\\\\\\\\\\\\\\\\\\
很快:

" AddHandler webbrowser1.Document.MouseOver \\ n \\ n \\ n \\ n \\ n \\ n \\ n \\ n \\ n ,AddressOf

Me.DisplayHyperlinks"


...语法声称在构建/编译时没有错误,但是

IntelliSense无法识别文档在webbrowser1之后对象。


为什么?


我希望我已经解释清楚了,

谢谢,


OnurGüzel

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

推荐答案



" kimiraikkonen" < ki ************* @ gmail.comwrote in message

news:2f ***************** ***************** @ m44g2000 hsc.googlegroups.com ...

你好,

我需要使用Webbrowser上的MouseOver事件不是由

webbrowser控件本身提供的(多么令人失望),所以我决定用另一条路线去

来模拟这个:

///////////////////////////////////////////// ///

Public Sub DisplayHyperlinks(ByVal sender As Object,ByVal e As

System.Windows.Forms.HtmlElementEventArgs)


''我的代码在这里


End Sub


Private Sub webbrowser1_DocumentCompleted(ByVal sender As

System.Object ,ByVal e As

System.Windows.Forms.WebBrowserDocumentCompletedEv entArgs)句柄

webbrowser1.DocumentCompleted


''这是我的问题

''虽然intellisense不承认文件,但我''我仍然可以编译

''并使用这个addhandler语法,没有任何构建或运行时错误

AddHandler webbrowser1.Document.MouseOver,AddressOf

Me.DisplayHyperlinks


End Sub

\\\\\\\\\\ \\\\\\\\\\\\\\\\\\\\\\\\\ \\ b \\ b $ b 
" AddHandler webbrowser1.Document.MouseOver,AddressOf

Me.DisplayHyperlinks"


....语法声称在构建/编译时没有错误,但

智能感知没有''认识到文件在webbrowser1之后对象。


为什么?


我希望我已经解释清楚了,

谢谢,


OnurGüzel


你想要得到什么?如果你试图获得一个链接,当鼠标

超过页面上的一个,你可以使用StatusTextChanged事件来获取链接。


LS


"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


kimiraikkonen写道:
kimiraikkonen wrote:

即将发布:

" AddHandler webbrowser1 .Document.MouseOver,AddressOf

Me.DisplayHyperlinks"


...语法在构建/编译时声明没有错误,但是

智能感知无法识别文档在webbrowser1之后对象。


为什么?
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?



它在我的机器上。 Me.WebBrowser1.Document出现了。其他什么

没有正确编译?

It does on my machine. Me.WebBrowser1.Document comes right up. Something else
not compiling correctly?



>

你想要得到什么?如果你试图获得一个链接,当鼠标

超过页面上的一个,你可以使用StatusTextChanged事件来获取链接。


LS
>
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



是的,但是当鼠标悬停在图像上时,这并没有提供这是我检索图像位置的目标。

目标。


但是,我是用AddHandler webbrowser1.Document.MouseOver,

AddressOf Me.DisplayHyperlinks做的。但我的问题和疑问只是

关于Intellisense为什么不提供文件的原因。在webbrowser1

之后,当你手动输入语法而不是从某个地方粘贴

时,你可以测试它。虽然IntelliSense没有提供,但是b $ b识别出文档。在webbrowser1之后对象,如果我输入没有

addhandler关键字只是为了在其他地方使用它的成员它看到

" Document" webbrowser1的成员没有任何问题的对象,但正如我所说,如果没有手动输入就粘贴代码,那么即使在构建我的应用程序时也没有错误

报告。


那是智能感知的奇怪。


谢谢,


Onur

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


这篇关于Webbrowser有趣的IntelliSense行为的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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