By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,501 Members | 2,850 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,501 IT Pros & Developers. It's quick & easy.

ListView on Tab Control - a workaround

P: n/a
tom
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
Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
TR
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" <to*@nuws.com> wrote in message
news:c1**************************@posting.google.c om...
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

Nov 12 '05 #2

P: n/a
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!
Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.