On Feb 23, 2007, at 7:33 PM, Tom Benson wrote:

> Just thought I'd let anyone who cares know
>
> If you are having refresh issues with the content of an HTMLviewer (I
> have mulitple overlapping instances on different page panel pages),
> then the answer is to set any of the instances that are not showing
> to have a width of zero.
>
> ie, in a pagepanels changed event
>
> dim n as integer
>
> for n = 0 to me.controlCount -1
>       if me.control(n) isa HTMLviewer and HTMLviewer(me.control
> (n)).pagepanelIndex <> me.value then
>                HTMLviewer(me.control(n)).width = 0
>       else
>                HTMLviewer(me.control(n)).width = desired width
>       end
> next
>


Tom:

Yes, this works, but the danger of this method is what happens if the  
user resizes the window while
you are "hiding" some of your viewers.     If your viewer objects are  
locked to the
width/heighth of the window, and the user resizes the window, the hidden
viewers suddenly become wider  (the width is no longer 0) and become  
partially visible (very ugly!).

A better method might be to move the viewers where they cannot ever  
be seen by setting
their top/left  coordinates to large negative numbers, which  
effectively displays them
somewhere far, far away....where the user will never see them.

Now when the user resizes the window, they will still not be visible  
on the screen
until you move them back into position...........but, they are still  
resized correctly!

if    .........
      HTMLviewer (me.control(n)). left) =   -20,000
           else
        HTMLviewer (me.control(n)). left) =  leftMargin      //where  
you want it shown
  end if

By using large negative numbers,  you are guaranteed that this method  
will not break if the screens
become larger/higher resolution in the future

BTW, this method also works for showing/hiding *any* control.......

Mark Levinson, MD
Hutchinson, KS


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to