|
Hi all, I'm creating my own ListView, which inherits 99% of it's functionality from built in ListView. One thing which standard Win32 API Listview support is the ability to hide the Headers in View.Details mode, but the .NET version does not appear to support this. I have tried the following in an attempt to add this functionality to MyListView, but it is not working... I thought that adding LVS_NOCOLUMNHEADER to the CreateParams style would help, but it does not. Can someone tell me where I'm going wrong. private const int LVS_NOCOLUMNHEADER = 0x4000; protected override CreateParams CreateParams { get { CreateParams cp = base.CreateParams; if ( !fShowColumnHeaders ) { // Hide the Column Headers cp.Style |= LVS_NOCOLUMNHEADER; } return cp; } } private bool fShowColumnHeaders; // Declares the property. [ Description("Show or hide the column headers") ] public bool ShowColumnHeaders { // Sets the method for retrieving the value of your property. get { return fShowColumnHeaders; } // Sets the method for setting the value of your property. set { if ( fShowColumnHeaders != value ) { fShowColumnHeaders = value; RecreateHandle(); } } } Thanks. |