WebBrowser WindowClosing

  • Thread starter Thread starter Vittorio
  • Start date Start date
V

Vittorio

Hi all,
I am trying to avoid that a webbrowser object will be closed by a
window.close() javascript. Trying to use the WindowClosing event i
discovered that it is not fired.
I am using VB.NET 1.1 and it seems that several events have the same
problem.

Can anyone help me to solve this issue?

Vittorio
 
A top level window can never be closed by javascript ( you will always need
the user to confirm the action )
if you are talking about a window ontop of the top level window then you
might add some script to the body`s onunload event handler

regards

Michel Posseth [MCP]
 
Hi Michel,
no, I was talking about the main window. The webBrowser shows the user
confirm dialog, but if the user closes it the object will be partially
destroyed. What I need to do is to avoid to unload the object and it
can be done using the Windows Closing Object. The related event is not
fired so it seems that something trivial in VB6 has become high tech
in VB.NET.

Regards,
Vittorio

A top level window can never be closed by javascript ( you will always need
the user to confirm the action )
if you are talking about a window ontop of the top level window then you
might add some script to the body`s onunload event handler

regards

Michel Posseth [MCP]


Vittorio said:
Hi all,
I am trying to avoid that a webbrowser object will be closed by a
window.close() javascript. Trying to use the WindowClosing event i
discovered that it is not fired.
I am using VB.NET 1.1 and it seems that several events have the same
problem.

Can anyone help me to solve this issue?

Vittorio
 
Vittorio,
What I need to do is to avoid to unload the object and it
can be done using the Windows Closing Object. The related event is not
fired so it seems that something trivial in VB6 has become high tech
in VB.NET.

The AxWebbrowser in version 1.x is the same in VBNet as in VB6.


In Version 2.0 is a new one, although that is as AxWebbrowswer is still a
wrapper around SHDOCVW


Cor


Vittorio said:
Hi Michel,
no, I was talking about the main window. The webBrowser shows the user
confirm dialog, but if the user closes it the object will be partially
destroyed. What I need to do is to avoid to unload the object and it
can be done using the Windows Closing Object. The related event is not
fired so it seems that something trivial in VB6 has become high tech
in VB.NET.

Regards,
Vittorio

A top level window can never be closed by javascript ( you will always
need
the user to confirm the action )
if you are talking about a window ontop of the top level window then you
might add some script to the body`s onunload event handler

regards

Michel Posseth [MCP]


Vittorio said:
Hi all,
I am trying to avoid that a webbrowser object will be closed by a
window.close() javascript. Trying to use the WindowClosing event i
discovered that it is not fired.
I am using VB.NET 1.1 and it seems that several events have the same
problem.

Can anyone help me to solve this issue?

Vittorio
 
Hi Cor,
yes it's okay... But I have to trap a non fired event!

Vittorio,
What I need to do is to avoid to unload the object and it
can be done using the Windows Closing Object. The related event is not
fired so it seems that something trivial in VB6 has become high tech
in VB.NET.

The AxWebbrowser in version 1.x is the same in VBNet as in VB6.


In Version 2.0 is a new one, although that is as AxWebbrowswer is still a
wrapper around SHDOCVW


Cor


Vittorio said:
Hi Michel,
no, I was talking about the main window. The webBrowser shows the user
confirm dialog, but if the user closes it the object will be partially
destroyed. What I need to do is to avoid to unload the object and it
can be done using the Windows Closing Object. The related event is not
fired so it seems that something trivial in VB6 has become high tech
in VB.NET.

Regards,
Vittorio

A top level window can never be closed by javascript ( you will always
need
the user to confirm the action )
if you are talking about a window ontop of the top level window then you
might add some script to the body`s onunload event handler

regards

Michel Posseth [MCP]


"Vittorio" <[email protected]> schreef in bericht

Hi all,
I am trying to avoid that a webbrowser object will be closed by a
window.close() javascript. Trying to use the WindowClosing event i
discovered that it is not fired.
I am using VB.NET 1.1 and it seems that several events have the same
problem.

Can anyone help me to solve this issue?

Vittorio
 
Vittorio,

There are some events, but I had to use them with a timer to let them work a
little bit, so don't expect that I can give a working example. I thought
even that IE 6 with SP does not even allow closing of the window anymore. I
am not sure of that.

By instance
size.changed
navigate error

Cor

Vittorio said:
Hi Cor,
yes it's okay... But I have to trap a non fired event!

Vittorio,
What I need to do is to avoid to unload the object and it
can be done using the Windows Closing Object. The related event is not
fired so it seems that something trivial in VB6 has become high tech
in VB.NET.

The AxWebbrowser in version 1.x is the same in VBNet as in VB6.


In Version 2.0 is a new one, although that is as AxWebbrowswer is still a
wrapper around SHDOCVW


Cor


Vittorio said:
Hi Michel,
no, I was talking about the main window. The webBrowser shows the user
confirm dialog, but if the user closes it the object will be partially
destroyed. What I need to do is to avoid to unload the object and it
can be done using the Windows Closing Object. The related event is not
fired so it seems that something trivial in VB6 has become high tech
in VB.NET.

Regards,
Vittorio

On Fri, 5 May 2006 18:04:13 +0200, "Michel Posseth [MCP]"

A top level window can never be closed by javascript ( you will always
need
the user to confirm the action )
if you are talking about a window ontop of the top level window then you
might add some script to the body`s onunload event handler

regards

Michel Posseth [MCP]


"Vittorio" <[email protected]> schreef in bericht

Hi all,
I am trying to avoid that a webbrowser object will be closed by a
window.close() javascript. Trying to use the WindowClosing event i
discovered that it is not fired.
I am using VB.NET 1.1 and it seems that several events have the same
problem.

Can anyone help me to solve this issue?

Vittorio
 
Hi Cor,
unfortunately when the user gives the permission the main window is
closed. This causes a partial unload of the object because of a bug.

Another way to solve my issue can be to force an unload and recreate
the control when needed, but I don't know how to recreate it.

Vittorio

Vittorio,

There are some events, but I had to use them with a timer to let them work a
little bit, so don't expect that I can give a working example. I thought
even that IE 6 with SP does not even allow closing of the window anymore. I
am not sure of that.

By instance
size.changed
navigate error

Cor

Vittorio said:
Hi Cor,
yes it's okay... But I have to trap a non fired event!

Vittorio,

What I need to do is to avoid to unload the object and it
can be done using the Windows Closing Object. The related event is not
fired so it seems that something trivial in VB6 has become high tech
in VB.NET.

The AxWebbrowser in version 1.x is the same in VBNet as in VB6.


In Version 2.0 is a new one, although that is as AxWebbrowswer is still a
wrapper around SHDOCVW


Cor


"Vittorio" <[email protected]> schreef in bericht
Hi Michel,
no, I was talking about the main window. The webBrowser shows the user
confirm dialog, but if the user closes it the object will be partially
destroyed. What I need to do is to avoid to unload the object and it
can be done using the Windows Closing Object. The related event is not
fired so it seems that something trivial in VB6 has become high tech
in VB.NET.

Regards,
Vittorio

On Fri, 5 May 2006 18:04:13 +0200, "Michel Posseth [MCP]"

A top level window can never be closed by javascript ( you will always
need
the user to confirm the action )
if you are talking about a window ontop of the top level window then you
might add some script to the body`s onunload event handler

regards

Michel Posseth [MCP]


"Vittorio" <[email protected]> schreef in bericht

Hi all,
I am trying to avoid that a webbrowser object will be closed by a
window.close() javascript. Trying to use the WindowClosing event i
discovered that it is not fired.
I am using VB.NET 1.1 and it seems that several events have the same
problem.

Can anyone help me to solve this issue?

Vittorio
 
Anyone has an idea on a solution for my event not fired issue???

Vittorio

Hi Cor,
unfortunately when the user gives the permission the main window is
closed. This causes a partial unload of the object because of a bug.

Another way to solve my issue can be to force an unload and recreate
the control when needed, but I don't know how to recreate it.

Vittorio

Vittorio,

There are some events, but I had to use them with a timer to let them work a
little bit, so don't expect that I can give a working example. I thought
even that IE 6 with SP does not even allow closing of the window anymore. I
am not sure of that.

By instance
size.changed
navigate error

Cor

Vittorio said:
Hi Cor,
yes it's okay... But I have to trap a non fired event!

On Mon, 8 May 2006 11:07:44 +0200, "Cor Ligthert [MVP]"

Vittorio,

What I need to do is to avoid to unload the object and it
can be done using the Windows Closing Object. The related event is not
fired so it seems that something trivial in VB6 has become high tech
in VB.NET.

The AxWebbrowser in version 1.x is the same in VBNet as in VB6.


In Version 2.0 is a new one, although that is as AxWebbrowswer is still a
wrapper around SHDOCVW


Cor


"Vittorio" <[email protected]> schreef in bericht
Hi Michel,
no, I was talking about the main window. The webBrowser shows the user
confirm dialog, but if the user closes it the object will be partially
destroyed. What I need to do is to avoid to unload the object and it
can be done using the Windows Closing Object. The related event is not
fired so it seems that something trivial in VB6 has become high tech
in VB.NET.

Regards,
Vittorio

On Fri, 5 May 2006 18:04:13 +0200, "Michel Posseth [MCP]"

A top level window can never be closed by javascript ( you will always
need
the user to confirm the action )
if you are talking about a window ontop of the top level window then you
might add some script to the body`s onunload event handler

regards

Michel Posseth [MCP]


"Vittorio" <[email protected]> schreef in bericht

Hi all,
I am trying to avoid that a webbrowser object will be closed by a
window.close() javascript. Trying to use the WindowClosing event i
discovered that it is not fired.
I am using VB.NET 1.1 and it seems that several events have the same
problem.

Can anyone help me to solve this issue?

Vittorio
 
Back
Top