Disappearing Listview Checkboxes on Multipage

KenMillard

Board Regular
Joined
Apr 25, 2007
Messages
151
I'm having problems as noted below.


Hi all

i'm using VBA in Outlook 2k. i created a mulitpage (with several sub-pages
inside) in a form. There is a Listview (report view, with checkbox) in a
sub-page with some rows of data. My problem is when I change the sub-page of
the listview to another and then go back, the checkboxes in the listview
disappeared (and the checkbox value also lost when i check it from a command
botton on another page).

Although i can get the checkboxes back when i click the cells of the chkbox
individually, the value are reset to false.

Does anyone meet the same problem and solve it? Please advice.
Thanks!
CS


That's from http://coding.derkeiler.com/Archive/General/comp.programming/2003-11/0058.html


It doesn't look like he got an answer.

I'm having the exact same problem. I'm working with Excel2003.

Thanks,

Ken
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Re: Disappearing Listview Checkboxes on Mulipage - Now I'm having another problem

When I switch between pages of the multipage, the listviews appear in the wrong locations. The altered locations seem to be consistent with each listview, there are 3 total. One moves from near the bottom of the multipage to near the top. The other two (on the other page) move up slightly.

I was having this problem a while back but then it went away. I thought I just exited excel and started it again and everything was fine but I'm not sure. Tried a full re-boot this time and it's still moving the listviews.

Any thoughts?


As far as the original issue, the only thing I could get to work was to clear out and re-fill the list view every time I change pages. All selections are cleared but at least the checkboxes are visible.
 
Upvote 0
Re: Disappearing Listview Checkboxes on Mulipage

I am also facing the same problem.

With regards to the listview appearing at weird places on the form load, the only workaround is to set the visible property of the list on form load. first make .visible = false and then .visible = true . User might experience a small flicker depending on the time of the form load but it would ensure that the control is placed at the desired location.
 
Upvote 0
Re: Disappearing Listview Checkboxes on Mulipage

Reloading the listviews on activating a page solves the problem, although the drawback is that any selections are lost in the process

This is how I did it, probably couple of lines are superfluous, but the bottom line is it worked for me.

Code:
Private Sub MultiPage1_Change()

If Me.MultiPage1.value = 1 Then
      With Me.ListView1[INDENT].Visible = False
            .ColumnHeaders.Clear
            .ListItems.Clear
            .CheckBoxes = True
            .Gridlines = True
            .HideColumnHeaders = False
            .View = lvwReport
            .Visible = True[/INDENT]
        End With
        Call LoadListView1
End If

If Me.MultiPage1.value = 2 Then
        With Me.ListView3[INDENT].ColumnHeaders.Clear
            .ListItems.Clear
            .Visible = False
            .Gridlines = True
            .CheckBoxes = True
            .HideColumnHeaders = False
            .View = lvwReport
            .Visible = True[/INDENT]
End With
         Call LoadListView3
End if

End sub

Private Sub UserForm_Initialize()
 With Me.ListView1
            .ColumnHeaders.Clear
            .ListItems.Clear
            .CheckBoxes = True
            .Gridlines = True
            .HideColumnHeaders = False
            .View = lvwReport
             .Visible = True
End With
Call LoadListView1


With Me.ListView3
            .ColumnHeaders.Clear
            .ListItems.Clear
            .Gridlines = True
            .HideColumnHeaders = False
            .View = lvwReport
            .Visible = True
End With
Call LoadListView3


End Sub

:)
 
Upvote 0
Re: Disappearing Listview Checkboxes on Mulipage

EDIT: Simplified version

Just put this into your LoadListView routine.

Code:
With Me.YourListView
            .ColumnHeaders.Clear
            .ListItems.Clear
            .Gridlines = True
            .CheckBoxes = True
            .HideColumnHeaders = False
            .View = lvwReport
            .Visible = True
        End With

Then there's no need to add the with statement into UserForm_Initialise or MultiPage1_Change Subs

This ensures all checkboxes are stable while using multiple listviews in multipage environment.
 
Upvote 0
Re: Disappearing Listview Checkboxes on Mulipage

I know this thread is old but maybe this would help someone in the future, I had this same problem today and solved it by looping through the listview as below
Code:
Dim i As Integer

    For i = 1 To Me.ListView1.ListItems.Count
        With Me.ListView1
            .ListItems(i).Checked = False
        End With
    Next i
 
Upvote 0
Re: Disappearing Listview Checkboxes on Mulipage

I know this thread is old but maybe this would help someone in the future, I had this same problem today and solved it by looping through the listview as below
Code:
Dim i As Integer

    For i = 1 To Me.ListView1.ListItems.Count
        With Me.ListView1
            .ListItems(i).Checked = False
        End With
    Next i
Thanks RobertRussel, this one worked for me today!
Checkbox are back shown, I just added the next to the multipage clic event to "redraw" and prevent it from showing in the top of the MultiPage frame:

VBA Code:
Private Sub MultiPage1_Click(ByVal Index As Long)
       ListView1.Visible = False
       ListView1.Visible = True
End Sub

You will see a quick blink, but that is all.
 
Upvote 0

Forum statistics

Threads
1,215,154
Messages
6,123,327
Members
449,098
Latest member
thnirmitha

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top