ListView.ColumnHeaderCollection.Insert 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
在指定的索引處插入欄位標頭。
多載
| 名稱 | Description |
|---|---|
| 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)
建立一個新的欄位標頭,包含指定的對齊文字、鍵、寬度和圖片鍵,並將標頭插入指定的索引中。
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)
建立一個新的欄位標頭,包含指定的對齊文字、鍵、寬度和圖片索引,並將標頭插入指定的索引中。
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)
建立一個新的欄位標頭,並將其插入指定的索引集合中。
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 或大於或等於 的ListView.ColumnHeaderCollection性質值Count。
備註
此版本 Insert 的方法允許您建立 ColumnHeader 一個新的欄位標題文字、寬度及文字對齊設定,並 ListView.ColumnHeaderCollection插入於 . 如果你想在現有的欄位標頭集合中插入新的欄位標頭,可以使用這個方法。 如果你想使用現有 ColumnHeader 的,並插入在集合中的特定位置,請使用該方法的 Insert 另一個版本。 若要新增欄位標頭而不指定集合中特定位置,請使用該 Add 方法。 如果你想在集合中加入一組欄位標頭,請使用這個 AddRange 方法。
另請參閱
適用於
Insert(Int32, String, String, Int32)
建立一個新的欄位標頭,包含指定的文字、鍵和寬度,並將標頭插入指定的索引中。
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)
建立一個新的欄位標頭,包含指定的文字與鍵,並將標頭插入指定的索引集合中。
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)
建立一個新的欄位標頭,包含指定的文字與初始寬度,並將標頭插入指定的索引中。
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)
在指定的索引處插入現有的欄位標頭。
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 或大於或等於 的ListView.ColumnHeaderCollection性質值Count。
備註
此版本Insert的方法允許你在 中插入特定位置ListView.ColumnHeaderCollection的存在ColumnHeader節點。
如果你想建立新 ColumnHeader 版本並插入到集合中的特定位置,請使用該方法的 Insert 另一個版本。 若要新增欄位標頭而不指定集合中特定位置,請使用該 Add 方法。 如果你想在集合中加入一組欄位標頭,請使用這個 AddRange 方法。
另請參閱
適用於
Insert(Int32, String)
建立一個新的欄位標頭,包含指定的文字,並將標頭插入指定的索引中。
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 或大於或等於 的ListView.ColumnHeaderCollection性質值Count。
備註
若要新增欄位標頭而不指定集合中的位置,請使用該 Add 方法。 如果你想在集合中加入一組欄位標頭,請使用這個 AddRange 方法。