語言

LegendItemsCollection.Add 方法

定義

在集合的末尾新增一個自訂 LegendItem 物件。

多載

名稱 Description
Add(Color, String)

在集合的末尾新增一個自訂 LegendItem 物件。

Add(String, String)

在集合的末尾新增一個帶有指定圖片的自訂 LegendItem 物件。

Add(Color, String)

在集合的末尾新增一個自訂 LegendItem 物件。

public:
 int Add(System::Drawing::Color color, System::String ^ text);
public int Add(System.Drawing.Color color, string text);
override this.Add : System.Drawing.Color * string -> int
Public Function Add (color As Color, text As String) As Integer

參數

color
Color

傳說物品的象徵顏色。

text
String

圖例道具文字。

傳回

一個 integer 代表該項目插入集合的零為基礎索引的位置。

備註

在集合末尾附加一個帶有指定文字與符號顏色的自訂圖例項目。

若要新增使用圖像作為符號的自訂圖例項目,請呼叫該 Add(String, String) 方法。

若要將自訂 LegendItem 元素插入集合,請使用本類別中的其中一個 Insert 方法。

適用於

Add(String, String)

在集合的末尾新增一個帶有指定圖片的自訂 LegendItem 物件。

public:
 int Add(System::String ^ image, System::String ^ text);
public int Add(string image, string text);
override this.Add : string * string -> int
Public Function Add (image As String, text As String) As Integer

參數

image
String

用於圖例項目符號的影像檔案的絕對或相對網址。

text
String

圖例道具文字。

傳回

一個 integer 代表該項目插入集合的零為基礎索引的位置。

備註

將自訂的圖例項目附加到收藏中,並附上指定的文字與圖片作為圖例項目的符號。

若要新增一個以顏色作為符號的自訂圖例項目,請呼叫該 Add(Color, String) 方法。

若要將物件插入 LegendItem 集合,請使用此類別中的其中一個 Insert 方法。

適用於