I was hoping to find a simple answer. Just looking for a simple construct, or example.
I just want a blank listview control like the one that is preloaded, so I can more customizable.
Here is the code I have made so far:
Public Class Enhancedlistview
Inherits ListView
Public Sub New()
MyBase.New
' Me.SuspendLayout()
Me.AllowColumnReorder = True
Me.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
Or System.Windows.Forms.AnchorStyles.Left) _
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.FullRowSelect = True
Me.GridLines = True
Me.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None
Me.HideSelection = False
Me.LabelWrap = False
Me.MultiSelect = False
Me.Name = "listviewex"
Me.OwnerDraw = True
Me.TabIndex = 0
Me.UseCompatibleStateImageBehavior = False
Me.View = System.Windows.Forms.View.Details
Me.ResumeLayout(False)
'add columns
Me.Columns.Add("Nonselectableside", 150, HorizontalAlignment.Left)
Me.Columns.Add("editableside", 150, HorizontalAlignment.Left)
End Sub
End Class
however, when I try to drag and drop the control I keep getting an error "Failed to load toolbox item "Enhancedlistview", it will be removed from the toolbox"
I created this in a class, is this the correct way to make a listview control?
What I have tried:
I tried to add size values to it and location values but it still does not work.