Skip to Content
.NET Windows Forms in a Nutshell
book

.NET Windows Forms in a Nutshell

by Ian Griffiths, Matthew Adams
March 2003
Intermediate to advanced
896 pages
32h 35m
English
O'Reilly Media, Inc.
Content preview from .NET Windows Forms in a Nutshell

Name

ColumnHeader

Synopsis

This class represents the heading of a column in a ListView control. Headers are added to a ListView through its Columns property, using the Add() method.

You can specify the Text to use to label the column, and how it is to be aligned horizontally within the column (TextAlign). You do not receive events directly from the header; instead, you should monitor the ListView class for appropriate notifications (e.g., the ColumnClick event).


public class ColumnHeader : System.ComponentModel.Component : ICloneable {

// Public Constructors

   public ColumnHeader();

// Public Instance Properties

   public int Index{get; }

   public ListView ListView{get; }

   public string Text{set; get; }

   public HorizontalAlignment TextAlign{set; get; }

   public int Width{set; get; }

// Public Instance Methods

   public object Clone();  // implements ICloneable

   public override string ToString();  // overrides System.ComponentModel.Component

                  // Protected Instance Methods

   protected override void Dispose(bool disposing);  // overrides System.ComponentModel.Component

}

Hierarchy

System.Object System.MarshalByRefObject System.ComponentModel.Component(System.ComponentModel.IComponen, System.IDisposable) ColumnHeader(System.ICloneable)

Returned By

ColumnHeaderCollection.this

Passed To

ColumnHeaderCollection.{Add(), AddRange(), Contains(), IndexOf(), Insert(), Remove()}

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Windows Forms 2.0 Programming

Windows Forms 2.0 Programming

Chris Sells, Michael Weinhardt
Pro C# 7: With .NET and .NET Core

Pro C# 7: With .NET and .NET Core

Andrew Troelsen, Philip Japikse

Publisher Resources

ISBN: 0596003382Supplemental ContentCatalog PageErrata