ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Help! Jumping ListViews! (https://www.excelbanter.com/excel-programming/399757-help-jumping-listviews.html)

Duncan[_7_]

Help! Jumping ListViews!
 
I'm writing some code on a userform that uses listview boxes.

Strangely the following code make the listview move around the form;

ListView1.Visible = False
ListView1.ListItems.Clear
ListView1.Visible = True

Can anyone else repeat this, and is there a workaround? (Obviously the
program is more complicated than this but it needs to selectively
hide listviews, change them and reveal them based on changing customer
selections).

Thanks everyone!


Nigel[_2_]

Help! Jumping ListViews!
 
Listview control v6 in xl2007 does the same for me.

It is the Clear action that causes the control to move.

If the control is visible and I clear it, it does not move. If it is not
visible and I clear it then it does move

What is even more curious is that the Left and Top values are not changed!

Do not know why?

--

Regards,
Nigel




"Duncan" wrote in message
ups.com...
I'm writing some code on a userform that uses listview boxes.

Strangely the following code make the listview move around the form;

ListView1.Visible = False
ListView1.ListItems.Clear
ListView1.Visible = True

Can anyone else repeat this, and is there a workaround? (Obviously the
program is more complicated than this but it needs to selectively
hide listviews, change them and reveal them based on changing customer
selections).

Thanks everyone!



Duncan[_7_]

Help! Jumping ListViews!
 
On 22 Oct, 13:56, "Nigel" wrote:
Listview control v6 in xl2007 does the same for me.

It is the Clear action that causes the control to move.

If the control is visible and I clear it, it does not move. If it is not
visible and I clear it then it does move

What is even more curious is that the Left and Top values are not changed!

Do not know why?

--

Regards,
Nigel


"Duncan" wrote in message

ups.com...

I'm writing some code on a userform that uses listview boxes.


Strangely the following code make the listview move around the form;


ListView1.Visible = False
ListView1.ListItems.Clear
ListView1.Visible = True


Can anyone else repeat this, and is there a workaround? (Obviously the
program is more complicated than this but it needs to selectively
hide listviews, change them and reveal them based on changing customer
selections).


Thanks everyone!


Thanks Nigel; yes setting the top and left values has no effect as
they become ignored. For future usenet reference after a bit of
fiddling I found a workaround;

ListView1.Visible = False
ListView1.ListItems.Clear
ListView1.Visible = True
ListView1.Visible = False 'extra command
ListView1.Visible = True 'extra command

This seems to do the trick. :o)




Anthony Ryan

Help! Jumping ListViews!
 
It does the same thing in xl2003. My listview control has checkboxes and
these blank out as well. I will try your solution below.

Thanks
Anthony

"Duncan" wrote in message
oups.com...
On 22 Oct, 13:56, "Nigel" wrote:
Listview control v6 in xl2007 does the same for me.

It is the Clear action that causes the control to move.

If the control is visible and I clear it, it does not move. If it is not
visible and I clear it then it does move

What is even more curious is that the Left and Top values are not
changed!

Do not know why?

--

Regards,
Nigel


"Duncan" wrote in message

ups.com...

I'm writing some code on a userform that uses listview boxes.


Strangely the following code make the listview move around the form;


ListView1.Visible = False
ListView1.ListItems.Clear
ListView1.Visible = True


Can anyone else repeat this, and is there a workaround? (Obviously the
program is more complicated than this but it needs to selectively
hide listviews, change them and reveal them based on changing customer
selections).


Thanks everyone!


Thanks Nigel; yes setting the top and left values has no effect as
they become ignored. For future usenet reference after a bit of
fiddling I found a workaround;

ListView1.Visible = False
ListView1.ListItems.Clear
ListView1.Visible = True
ListView1.Visible = False 'extra command
ListView1.Visible = True 'extra command

This seems to do the trick. :o)





All times are GMT +1. The time now is 04:45 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com