How to detect Internet Explorer window resize event in VB.NET and hide bar on this event?

Add-in Express™ Support Service
That's what is more important than anything else

How to detect Internet Explorer window resize event in VB.NET and hide bar on this event?
 
Ivars Bor??evs




Posts: 9
Joined: 2011-11-07
Hey there!

Is there a way to detect Internet Explorer window resize in VB.NET while using Advanced Bar and hide the bar on this event if it takes too much space ?

I need to hide the Advanced Bar if the user resizes Internet Explorer window to smaller size
(or if some site opens small popup screen - i definitely do not want the bar to be visible in popup screens - for example if user opens twitter authorization window in some site, then there is no need to show bar in this authorization popup window).

Main idea is to hide Advanced bar if the space taken by the bar is larger than 30% of the whole browser window.
Posted 07 Nov, 2011 09:30:43 Top
Ivars Bor??evs




Posts: 9
Joined: 2011-11-07
Maybe it is possible to use the following event to detect IE browser screen size change ?


Public Event OnResizeEnd(ByVal sender As Object, ByVal eventObject As Object)
     Member of AddinExpress.IE.ADXIEHTMLDocEvents
Summary:
Fires when the user finishes changing the dimensions of the object in a control selection.

Remarks:
See ^http://msdn.microsoft.com/en-us/library/aa741317(VS.85).aspx on MSDN.
Posted 08 Nov, 2011 02:24:35 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Ivars,

I will develop an example for you. Please wait a little.
Posted 08 Nov, 2011 03:35:36 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Ivars, please download the example here:
http://www.add-in-express.com/files/projects_pub/ie-auto-hide-advbar-cs.zip
Let me know if you need anything else.
Posted 08 Nov, 2011 09:30:25 Top
Ivars Bor??evs




Posts: 9
Joined: 2011-11-07
Thanks, I will look at it first thing tomorrow morning.
Posted 08 Nov, 2011 09:35:56 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Ivars, the example is written in C#. I will rewrite it in VB.NET if need it.
Posted 08 Nov, 2011 10:29:55 Top
Ivars Bor??evs




Posts: 9
Joined: 2011-11-07
Sergey,

I tried your example in C#, but it is too advanced for me :)
It would be really nice if you could rewrite in in VB.NET.

Sorry for inconvenience.
Posted 09 Nov, 2011 09:52:46 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
No problem. I will rewrite it ASAP.
Posted 10 Nov, 2011 08:30:38 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Ivars,

You can download the VB.NET example here:
http://www.add-in-express.com/files/projects_pub/ie-auto-hide-advbar-vb.zip
Posted 11 Nov, 2011 07:48:27 Top
Ivars Bor??evs




Posts: 9
Joined: 2011-11-07
Hey,

I tried the VB.NET example and it works, but there are two problems:

1. If I resize the screen till the bar is hidden and then close the internet explorer, then at the next start the bar stays hidden and only way to enable it is through IE -> View -> Explorer Bars

If I force it visible in
   
 Private Sub IEModule_OnConnect(ByVal sender As System.Object, ByVal threadId As System.Int32) Handles MyBase.OnConnect
        Me.AdxieAdvancedBarItem.Visible = True
End Sub


then AdxiehtmlDocEvents1_OnResize stops working.


2. The OnResize event obviously fires only when the internet explorer window gets resized - but is there any way to hide the bar in the new internet explorer popup windows which are smaller than 30% of the whole browser window ?

One example of such a window is Twitter authorization popup un pages with Tweet button (http://twitter.com/about/resources/tweetbutton)
Posted 14 Nov, 2011 10:23:12 Top