简体   繁体   中英

ListViewGroup shows items but not headers

I have read through several forums and tried different options. Most of the answers were this , which makes me assume that would be the issue. I placed Application.EnableVisualStyles() at the beginning of InitializeComponent() in the .Designer.vb file as seen below:

<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()>
Partial Class MetadataCollectionGUI
    Inherits System.Windows.Forms.Form

    'Form overrides dispose to clean up the component list.
    <System.Diagnostics.DebuggerNonUserCode()>
    Protected Overrides Sub Dispose(ByVal disposing As Boolean)
        Try
            If disposing AndAlso components IsNot Nothing Then
                components.Dispose()
            End If
        Finally
            MyBase.Dispose(disposing)
        End Try
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    <System.Diagnostics.DebuggerStepThrough()>
    Private Sub InitializeComponent()
        Application.EnableVisualStyles() '     <--- See Here
        Me.ListViewMetaDataCollection = New System.Windows.Forms.ListView()
        Me.ColumnTags = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
        etc... etc...
    End Sub
    
    Etc...
    
End Class

Did I misunderstand how to execute that particular solution or is the issue something different?

I found out what the issue was. Go to the project properties and enable the application framework. Now you can enabled the XP visual styles.

在此处输入图片说明


Thank you Hursey & jmcilhinney, I would not have figured it out without you all!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM