通过


ListView.ColumnHeaderCollection.Insert 方法

定义

将列标题插入集合中的指定索引处。

重载

名称 说明
Insert(Int32, String, String, Int32, HorizontalAlignment, String)

使用指定的对齐文本、键、宽度和图像键创建新的列标题,并将标题插入到集合中的指定索引处。

Insert(Int32, String, String, Int32, HorizontalAlignment, Int32)

创建具有指定对齐文本、键、宽度和图像索引的新列标题,并将标题插入到集合中的指定索引处。

Insert(Int32, String, Int32, HorizontalAlignment)

创建新的列标题并将其插入到集合中的指定索引处。

Insert(Int32, String, String, Int32)

创建具有指定文本、键和宽度的新列标题,并将标题插入集合中的指定索引处。

Insert(Int32, String, String)

创建具有指定文本和键的新列标题,并将标头插入集合中的指定索引处。

Insert(Int32, String, Int32)

创建具有指定文本和初始宽度的新列标题,并将标题插入集合中的指定索引处。

Insert(Int32, ColumnHeader)

将现有列标题插入集合中的指定索引处。

Insert(Int32, String)

创建具有指定文本的新列标题,并将标题插入集合中的指定索引处。

Insert(Int32, String, String, Int32, HorizontalAlignment, String)

Source:
ListView.ColumnHeaderCollection.cs
Source:
ListView.ColumnHeaderCollection.cs
Source:
ListView.ColumnHeaderCollection.cs
Source:
ListView.ColumnHeaderCollection.cs
Source:
ListView.ColumnHeaderCollection.cs

使用指定的对齐文本、键、宽度和图像键创建新的列标题,并将标题插入到集合中的指定索引处。

public:
 void Insert(int index, System::String ^ key, System::String ^ text, int width, System::Windows::Forms::HorizontalAlignment textAlign, System::String ^ imageKey);
public void Insert(int index, string key, string text, int width, System.Windows.Forms.HorizontalAlignment textAlign, string imageKey);
member this.Insert : int * string * string * int * System.Windows.Forms.HorizontalAlignment * string -> unit
Public Sub Insert (index As Integer, key As String, text As String, width As Integer, textAlign As HorizontalAlignment, imageKey As String)

参数

index
Int32

插入列标题的从零开始的索引位置。

key
String

列标题的名称。

text
String

要显示在列标题中的文本。

width
Int32

列标题的初始宽度(以像素为单位)。

textAlign
HorizontalAlignment

其中一个 HorizontalAlignment 值。

imageKey
String

要显示在列标题中的图像的键。

注解

若要在不指定集合中的位置的情况下添加列标题,请使用 Add 该方法。 如果要将列标题数组添加到集合中,请使用 AddRange 该方法。

Name 属性对应于 .. 中的列的 ListView.ColumnHeaderCollection键。

适用于

Insert(Int32, String, String, Int32, HorizontalAlignment, Int32)

Source:
ListView.ColumnHeaderCollection.cs
Source:
ListView.ColumnHeaderCollection.cs
Source:
ListView.ColumnHeaderCollection.cs
Source:
ListView.ColumnHeaderCollection.cs
Source:
ListView.ColumnHeaderCollection.cs

创建具有指定对齐文本、键、宽度和图像索引的新列标题,并将标题插入到集合中的指定索引处。

public:
 void Insert(int index, System::String ^ key, System::String ^ text, int width, System::Windows::Forms::HorizontalAlignment textAlign, int imageIndex);
public void Insert(int index, string key, string text, int width, System.Windows.Forms.HorizontalAlignment textAlign, int imageIndex);
member this.Insert : int * string * string * int * System.Windows.Forms.HorizontalAlignment * int -> unit
Public Sub Insert (index As Integer, key As String, text As String, width As Integer, textAlign As HorizontalAlignment, imageIndex As Integer)

参数

index
Int32

插入列标题的从零开始的索引位置。

key
String

列标题的名称。

text
String

要显示在列标题中的文本。

width
Int32

列标题的初始宽度(以像素为单位)。

textAlign
HorizontalAlignment

其中一个 HorizontalAlignment 值。

imageIndex
Int32

要显示在列标题中的图像的索引。

注解

若要在不指定集合中的位置的情况下添加列标题,请使用 Add 该方法。 如果要将列标题数组添加到集合中,请使用 AddRange 该方法。

Name 属性对应于 .. 中的列的 ListView.ColumnHeaderCollection键。

适用于

Insert(Int32, String, Int32, HorizontalAlignment)

Source:
ListView.ColumnHeaderCollection.cs
Source:
ListView.ColumnHeaderCollection.cs
Source:
ListView.ColumnHeaderCollection.cs
Source:
ListView.ColumnHeaderCollection.cs
Source:
ListView.ColumnHeaderCollection.cs

创建新的列标题并将其插入到集合中的指定索引处。

public:
 void Insert(int index, System::String ^ str, int width, System::Windows::Forms::HorizontalAlignment textAlign);
public:
 void Insert(int index, System::String ^ text, int width, System::Windows::Forms::HorizontalAlignment textAlign);
public void Insert(int index, string str, int width, System.Windows.Forms.HorizontalAlignment textAlign);
public void Insert(int index, string text, int width, System.Windows.Forms.HorizontalAlignment textAlign);
member this.Insert : int * string * int * System.Windows.Forms.HorizontalAlignment -> unit
member this.Insert : int * string * int * System.Windows.Forms.HorizontalAlignment -> unit
Public Sub Insert (index As Integer, str As String, width As Integer, textAlign As HorizontalAlignment)
Public Sub Insert (index As Integer, text As String, width As Integer, textAlign As HorizontalAlignment)

参数

index
Int32

插入列标题的从零开始的索引位置。

strtext
String

要显示在列标题中的文本。

width
Int32

列标题的初始宽度。 设置为 -1 将列标题自动调整为列中最大子项文本的大小,或 -2 自动将列标题自动调整为列标题的文本大小。

textAlign
HorizontalAlignment

其中一个 HorizontalAlignment 值。

例外

index 小于 0 或大于或等于 CountListView.ColumnHeaderCollection属性的值。

注解

此方法的Insert此版本使你能够创建一个ColumnHeader具有特定列标题文本、宽度和文本对齐设置的新方法,并将其插入到特定位置。ListView.ColumnHeaderCollection 如果要将新的列标题插入到列标题的现有集合中,可以使用此方法。 如果要使用现有 ColumnHeader 项并将其插入集合中的特定位置,请使用该方法的其他版本 Insert 。 若要在不指定集合中的特定位置的情况下添加列标题,请使用 Add 该方法。 如果要将列标题数组添加到集合中,请使用 AddRange 该方法。

另请参阅

适用于

Insert(Int32, String, String, Int32)

Source:
ListView.ColumnHeaderCollection.cs
Source:
ListView.ColumnHeaderCollection.cs
Source:
ListView.ColumnHeaderCollection.cs
Source:
ListView.ColumnHeaderCollection.cs
Source:
ListView.ColumnHeaderCollection.cs

创建具有指定文本、键和宽度的新列标题,并将标题插入集合中的指定索引处。

public:
 void Insert(int index, System::String ^ key, System::String ^ text, int width);
public void Insert(int index, string key, string text, int width);
member this.Insert : int * string * string * int -> unit
Public Sub Insert (index As Integer, key As String, text As String, width As Integer)

参数

index
Int32

插入列标题的从零开始的索引位置。

key
String

列标题的名称。

text
String

要显示在列标题中的文本。

width
Int32

列标题的初始宽度(以像素为单位)。

注解

若要在不指定集合中的位置的情况下添加列标题,请使用 Add 该方法。 如果要将列标题数组添加到集合中,请使用 AddRange 该方法。

Name 属性对应于 .. 中的列的 ListView.ColumnHeaderCollection键。

适用于

Insert(Int32, String, String)

Source:
ListView.ColumnHeaderCollection.cs
Source:
ListView.ColumnHeaderCollection.cs
Source:
ListView.ColumnHeaderCollection.cs
Source:
ListView.ColumnHeaderCollection.cs
Source:
ListView.ColumnHeaderCollection.cs

创建具有指定文本和键的新列标题,并将标头插入集合中的指定索引处。

public:
 void Insert(int index, System::String ^ key, System::String ^ text);
public void Insert(int index, string key, string text);
member this.Insert : int * string * string -> unit
Public Sub Insert (index As Integer, key As String, text As String)

参数

index
Int32

插入列标题的从零开始的索引位置。

key
String

列标题的名称。

text
String

要显示在列标题中的文本。

注解

若要在不指定集合中的位置的情况下添加列标题,请使用 Add 该方法。 如果要将列标题数组添加到集合中,请使用 AddRange 该方法。

Name 属性对应于 .. 中的列的 ListView.ColumnHeaderCollection键。

适用于

Insert(Int32, String, Int32)

Source:
ListView.ColumnHeaderCollection.cs
Source:
ListView.ColumnHeaderCollection.cs
Source:
ListView.ColumnHeaderCollection.cs
Source:
ListView.ColumnHeaderCollection.cs
Source:
ListView.ColumnHeaderCollection.cs

创建具有指定文本和初始宽度的新列标题,并将标题插入集合中的指定索引处。

public:
 void Insert(int index, System::String ^ text, int width);
public void Insert(int index, string text, int width);
member this.Insert : int * string * int -> unit
Public Sub Insert (index As Integer, text As String, width As Integer)

参数

index
Int32

插入列标题的从零开始的索引位置。

text
String

要显示在列标题中的文本。

width
Int32

列标题的初始宽度(以像素为单位)。

注解

若要在不指定集合中的位置的情况下添加列标题,请使用 Add 该方法。 如果要将列标题数组添加到集合中,请使用 AddRange 该方法。

适用于

Insert(Int32, ColumnHeader)

Source:
ListView.ColumnHeaderCollection.cs
Source:
ListView.ColumnHeaderCollection.cs
Source:
ListView.ColumnHeaderCollection.cs
Source:
ListView.ColumnHeaderCollection.cs
Source:
ListView.ColumnHeaderCollection.cs

将现有列标题插入集合中的指定索引处。

public:
 void Insert(int index, System::Windows::Forms::ColumnHeader ^ value);
public void Insert(int index, System.Windows.Forms.ColumnHeader value);
member this.Insert : int * System.Windows.Forms.ColumnHeader -> unit
Public Sub Insert (index As Integer, value As ColumnHeader)

参数

index
Int32

插入列标题的从零开始的索引位置。

value
ColumnHeader

ColumnHeader 插入到集合中。

例外

index 小于 0 或大于或等于 CountListView.ColumnHeaderCollection属性的值。

注解

此方法的Insert此版本使你能够在其中的特定位置ListView.ColumnHeaderCollection插入现有ColumnHeader项。

如果要创建新 ColumnHeader 项并将其插入集合中的特定位置,请使用该方法的其他版本 Insert 。 若要在不指定集合中的特定位置的情况下添加列标题,请使用 Add 该方法。 如果要将列标题数组添加到集合中,请使用 AddRange 该方法。

另请参阅

适用于

Insert(Int32, String)

Source:
ListView.ColumnHeaderCollection.cs
Source:
ListView.ColumnHeaderCollection.cs
Source:
ListView.ColumnHeaderCollection.cs
Source:
ListView.ColumnHeaderCollection.cs
Source:
ListView.ColumnHeaderCollection.cs

创建具有指定文本的新列标题,并将标题插入集合中的指定索引处。

public:
 void Insert(int index, System::String ^ text);
public void Insert(int index, string text);
member this.Insert : int * string -> unit
Public Sub Insert (index As Integer, text As String)

参数

index
Int32

插入列标题的从零开始的索引位置。

text
String

要显示在列标题中的文本。

例外

index 小于 0 或大于或等于 CountListView.ColumnHeaderCollection属性的值。

注解

若要在不指定集合中的位置的情况下添加列标题,请使用 Add 该方法。 如果要将列标题数组添加到集合中,请使用 AddRange 该方法。

适用于