|
-
Apr 12th, 2011, 05:25 PM
#1
Thread Starter
Lively Member
[RESOLVED] Actions of list box
I posted this situation once before and thought I had it taken care of but find I still have the problem.
I have created a ListBox (lstModels) with properties of:
Sorted = False
Columns = 2
MultiSelect = 0
Style = 1 - Checkbox
In the Form Load procedure I enter 16 entries. The first entry is for selecting "All Models." The height of the list box allows 10 entries before spililing over to the next column. When displayed the list box always Appears to have 3 columns always with a horizontal slider shown.
If I check on any entry in column 1 the check box is checked. If I select the "All models" entry the sub-routine is called that checks all entries. If i clink on the "All models" when that have been previously all been checked all are unchecked. So far, so good.
If I check ANY entry in column 2 the following happens. The entry does not show that it has been checked, all remaining entries in column 2 no longer show the check boxes (except the one that was clicked on), and the entire list box shifts to the right to display the "3 rd" column (column1 is no longer visible).
The only procedure in the module that involves the list box is the following.
Private Sub lstModels_Click()
Dim N As Integer
' if all models was click and all not currently selected then set on all model
' in the list
If lstModels.Selected(0) = True And mCurrAll <> 1 Then
For N = 1 To lstModels.ListCount - 1
lstModels.Selected(N) = True
Next N
' set modular flag to indicate that all was previously selected
mCurrAll = 1
' if all models was set to off and all models had been selected then set all
' to off
ElseIf lstModels.Selected(0) = False And mCurrAll = 1 Then
For N = 1 To lstModels.ListCount - 1
lstModels.Selected(N) = False
Next N
mCurrAll = 0
End If
End Sub
I have tried many many times to adjust the width oif the list box thinging thgat that might be causing the "extra" column but have not been able to make it appear as I think it should "2 columns"
Any suggestions on what could be causing this would be geratly appreciated.
Marv
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|