|
-
Apr 19th, 2018, 04:37 AM
#1
Thread Starter
Member
[RESOLVED] ListView not responding to code
I have an app that loads a ListView with a list of applications currently installed on the PC, and their uninstall string commands.
However, try as I might, I cannot get the ListView to respond to any of my code commands, except for resizing when the main form is resized.
Here's the code that sets up the ListView:
Code:
With Me.ListView1
.Width = Me.Width - 500
.Height = Me.Height - 1400
.Top = 840
.View = lvwReport
.GridLines = True
.FullRowSelect = True
.ListItems.Clear
.ColumnHeaders.Clear
.ColumnHeaders.Add , , "Application Name", 5000, lvwColumnLeft
.ColumnHeaders.Add , , "Uninstall String extracted from Registry", 70000, lvwColumnLeft
End With
This is how the data is loaded:
Code:
If strValue2 <> "" Then
Set lstItem = Me.ListView1.ListItems.Add() ' Add items and subitems to list control.
lstItem.Text = strValue1
lstItem.SubItems(1) = strValue2
End If
The result is just a ListView that fills the main form, with just one entry, the first item loaded.
There are no column headers, and no gridlines, either.
The resize code, which works, is this:
Code:
Private Sub Form_Resize()
With Me.ListView1
.Width = Me.Width - 500
.Height = Me.Height - 1400
End With
End Sub
I've tried regsvr32 mscomctl.ocx, but that, when run as Administrator, completes without error.
I'm running this under Windows 10, one PC is 64Bit, another is 32Bit.
Can anyone see where I'm going wrong? This is driving me nuts!
Jim
Tags for this Thread
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
|