Connecting Tech Pros Worldwide Forums | Help | Site Map

ListView on Tab Control - a workaround

tom
Guest
 
Posts: n/a
#1: Nov 12 '05
Hey All-

For those of you having troubles with listviews appearing in the
wrong position when on a tab control, we've come up w/one other
workaround that may be useful.

When you move to the tab page containing the listview (tab's
onChange event), fire off your form timer by setting the timer
interval (me.timerinterval = 1)

Then, in the event code for form timer have the following:

================================================== =
Private Sub Form_Timer()
On Error Resume Next
Me.TimerInterval = 0
DoCmd.MoveSize , , Me.WindowWidth + 10, Me.WindowHeight
DoCmd.MoveSize , , Me.WindowWidth - 10, Me.WindowHeight
End Sub
================================================== =

This will make the listView go to where you've put it, and not
showup in the upper left-hand corner.

-td

TR
Guest
 
Posts: n/a
#2: Nov 12 '05

re: ListView on Tab Control - a workaround


Hi Tom,
I have another alternative, which also utilizes the tab change event.
Simply make the control invisible by default. Make it visible only when its
tab page is visible, i.e in the tab change event:
me.lstListview.visible = (me.tabMyTab= page_with_listview)
Perhaps not anymore effective, but as a developer I personally do not like
the timer event.
Just another alternative.
Also, I have found that this problem exists only with certain versions of
the listview control. I'm at home, so I cannot give you a version number
that works, but at work we find an earlier version of mscomclt has no
problems, a later version exhibits the "out of position" problem. We just
make sure everyone has the earlier control registered. Since 99% of our apps
are used "inhouse" this is not a problem.



"tom" <tom@nuws.com> wrote in message
news:c17f6324.0310131229.3b210085@posting.google.c om...[color=blue]
> Hey All-
>
> For those of you having troubles with listviews appearing in the
> wrong position when on a tab control, we've come up w/one other
> workaround that may be useful.
>
> When you move to the tab page containing the listview (tab's
> onChange event), fire off your form timer by setting the timer
> interval (me.timerinterval = 1)
>
> Then, in the event code for form timer have the following:
>
> ================================================== =
> Private Sub Form_Timer()
> On Error Resume Next
> Me.TimerInterval = 0
> DoCmd.MoveSize , , Me.WindowWidth + 10, Me.WindowHeight
> DoCmd.MoveSize , , Me.WindowWidth - 10, Me.WindowHeight
> End Sub
> ================================================== =
>
> This will make the listView go to where you've put it, and not
> showup in the upper left-hand corner.
>
> -td[/color]


Tom Darci
Guest
 
Posts: n/a
#3: Nov 12 '05

re: ListView on Tab Control - a workaround


Hey TR-
Thanks. That's an even better workaround as (a) I don't like the timer
much either and (b) it's a bit strange to be messing around with
resizing the form on them.

-tom


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Closed Thread