473,399 Members | 2,858 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,399 software developers and data experts.

Problem handling events with web browser control

I have a Catch-22 type problem with the web browser control in VB Dot Net.

I can have complete functionality on a web page in the control. But as soon
as I add event handlers to the vb app (e.g. onclick event) , the behavior of
the web page in the control changes drastically. Input boxes will not
accept the focus. No data can be entered. As soon as the event handler is
removed and the app recompiled, functionality is restored.

The idea, of course, is to access the control programatically from vb.
However, I am being thwarted somewhare along the way. I don't know whether
it's by design or whether I have made the wrong declarations somewhere in
the code...

This programming technique works splendidly in VB6. I am just unable to
port it to dot net.

Any suggestions or insight would be appreciated.

Thanks,

Reid

Nov 20 '05 #1
5 4274
Hi Reid

This is a known problem. Have a look here for a solution

http://support.microsoft.com/default...b;EN-US;311284

HTH

Charles
"Reid" <Re**@usadiscounters.net> wrote in message
news:Oi**************@TK2MSFTNGP10.phx.gbl...
I have a Catch-22 type problem with the web browser control in VB Dot Net.

I can have complete functionality on a web page in the control. But as soon as I add event handlers to the vb app (e.g. onclick event) , the behavior of the web page in the control changes drastically. Input boxes will not
accept the focus. No data can be entered. As soon as the event handler is removed and the app recompiled, functionality is restored.

The idea, of course, is to access the control programatically from vb.
However, I am being thwarted somewhare along the way. I don't know whether it's by design or whether I have made the wrong declarations somewhere in
the code...

This programming technique works splendidly in VB6. I am just unable to
port it to dot net.

Any suggestions or insight would be appreciated.

Thanks,

Reid

Nov 20 '05 #2
Hi Reid,

The normal axwebbrowser control?

Cor

I can have complete functionality on a web page in the control. But as soon as I add event handlers to the vb app (e.g. onclick event) , the behavior of the web page in the control changes drastically. Input boxes will not
accept the focus. No data can be entered. As soon as the event handler is removed and the app recompiled, functionality is restored.

The idea, of course, is to access the control programatically from vb.
However, I am being thwarted somewhare along the way. I don't know whether it's by design or whether I have made the wrong declarations somewhere in
the code...

This programming technique works splendidly in VB6. I am just unable to
port it to dot net.

Any suggestions or insight would be appreciated.

Thanks,

Reid

Nov 20 '05 #3
Yes. Vanilla flavored!

"Cor Ligthert" <no**********@planet.nl> wrote in message
news:ew**************@TK2MSFTNGP09.phx.gbl...
Hi Reid,

The normal axwebbrowser control?

Cor

I can have complete functionality on a web page in the control. But as soon
as I add event handlers to the vb app (e.g. onclick event) , the behavior of
the web page in the control changes drastically. Input boxes will not
accept the focus. No data can be entered. As soon as the event handler

is
removed and the app recompiled, functionality is restored.

The idea, of course, is to access the control programatically from vb.
However, I am being thwarted somewhare along the way. I don't know

whether
it's by design or whether I have made the wrong declarations somewhere

in the code...

This programming technique works splendidly in VB6. I am just unable to
port it to dot net.

Any suggestions or insight would be appreciated.

Thanks,

Reid


Nov 20 '05 #4
I tried the example but am still having the same problem.

The example uses microsoft's web site as its illustrative page.
Unfortunately, the app does not allow anything to be entered in the search
field (INPUT type=text) or even to accept the focus. So I'm right back
where I started.

Any ideas?

Thanks,

Reid


"Charles Law" <bl***@nowhere.com> wrote in message
news:eV*************@TK2MSFTNGP11.phx.gbl...
Hi Reid

This is a known problem. Have a look here for a solution

http://support.microsoft.com/default...b;EN-US;311284

HTH

Charles
"Reid" <Re**@usadiscounters.net> wrote in message
news:Oi**************@TK2MSFTNGP10.phx.gbl...
I have a Catch-22 type problem with the web browser control in VB Dot Net.
I can have complete functionality on a web page in the control. But as soon
as I add event handlers to the vb app (e.g. onclick event) , the behavior of
the web page in the control changes drastically. Input boxes will not
accept the focus. No data can be entered. As soon as the event handler

is
removed and the app recompiled, functionality is restored.

The idea, of course, is to access the control programatically from vb.
However, I am being thwarted somewhare along the way. I don't know

whether
it's by design or whether I have made the wrong declarations somewhere

in the code...

This programming technique works splendidly in VB6. I am just unable to
port it to dot net.

Any suggestions or insight would be appreciated.

Thanks,

Reid


Nov 20 '05 #5
Reid

Create a class that implements HTMLDocumentEvents2 (say, DocumentEvents2).
For default behaviour return True from each of the functions.

Then call the following function from the DocumentComplete event handler.

<code>
Private Sub EnableDocEvents()

Dim icp As UCOMIConnectionPoint
Dim icpc As UCOMIConnectionPointContainer
Dim g As Guid

g = GetType(mshtml.HTMLDocumentEvents2).GUID

icpc = DirectCast(Document, UCOMIConnectionPointContainer)

icpc.FindConnectionPoint(g, icp)

If m_DocEvents2Cookie <> -1 Then
icp.Unadvise(m_DocEvents2Cookie)

m_DocEvents2Cookie = -1
End If

m_DocumentEvents2 = New DocumentEvents2(Me)

icp.Advise(m_DocumentEvents2, m_DocEvents2Cookie)

' Wait until the browser has settled before returning
WaitReady()

End Sub
</code>

m_DocEvents2Cookie is a module level private integer, initialised to -1.

Declare m_DocumentEvents2 WithEvents As DocumentEvents2 at module level as
well.

As I say, this is a known problem, and depending on what you want to achieve
you need to go to increasing lengths to overcome it.

HTH

Charles
"Reid" <Re**@usadiscounters.net> wrote in message
news:uP**************@TK2MSFTNGP09.phx.gbl...
I tried the example but am still having the same problem.

The example uses microsoft's web site as its illustrative page.
Unfortunately, the app does not allow anything to be entered in the search
field (INPUT type=text) or even to accept the focus. So I'm right back
where I started.

Any ideas?

Thanks,

Reid


"Charles Law" <bl***@nowhere.com> wrote in message
news:eV*************@TK2MSFTNGP11.phx.gbl...
Hi Reid

This is a known problem. Have a look here for a solution

http://support.microsoft.com/default...b;EN-US;311284

HTH

Charles
"Reid" <Re**@usadiscounters.net> wrote in message
news:Oi**************@TK2MSFTNGP10.phx.gbl...
I have a Catch-22 type problem with the web browser control in VB Dot Net.
I can have complete functionality on a web page in the control. But as
soon
as I add event handlers to the vb app (e.g. onclick event) , the behavior
of
the web page in the control changes drastically. Input boxes will not
accept the focus. No data can be entered. As soon as the event
handler is
removed and the app recompiled, functionality is restored.

The idea, of course, is to access the control programatically from vb.
However, I am being thwarted somewhare along the way. I don't know

whether
it's by design or whether I have made the wrong declarations somewhere

in the code...

This programming technique works splendidly in VB6. I am just unable

to port it to dot net.

Any suggestions or insight would be appreciated.

Thanks,

Reid



Nov 20 '05 #6

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

Similar topics

3
by: Andrew Mayo | last post by:
(note: reason for posting here; browser helper object is written in C++; C++ developers tend to know the intricacies of message handling; this looks like a Windows messaging issue) Microsoft...
2
by: Eric Newton | last post by:
VB's more declarative nature of handling events is golden. I'm hoping C# will acquire this type of deal, in addition to the anonymous delegates. could do same as vb (actually would be easier to...
0
by: Robin Tucker | last post by:
Hi people, Is it possible for me to handle events raised by an object which is embeded in a web browser control, from my VB.NET code? I am able to gain access to the object itself through the...
6
by: Robin Bonin | last post by:
In my user contol I am creating a set of dropdownlists. Each list is created based on input from the other lists. The problem I am having is setting the selected index on the lists. If someone...
3
by: Tim::.. | last post by:
Can someone please tell my why I get the following problem when I type the following piece of code! How do I get around this??? The idea is that when a user clicks a button on a form it causes...
10
by: Charles Law | last post by:
For some reason, when I click the X to close my MDI parent form, the action appears to be re-directed to one of the MDI child forms, and the parent remains open. I am then unable to close the...
12
by: Mahesh Devjibhai Dhola [MVP] | last post by:
Hi, I have added few of the events in some control, example code is: btnControl.GotFocus +=new EventHandler(EventHandlingMethod); btnControl.Click +=new EventHandler(EventHandlingMethod);...
6
by: Joel | last post by:
2 Questions: (1) The documentation says application.run() creates a standard message loop on the current thread and "optionally" shows a form. This is really confusing because I was of the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.