语言

LegendCellCollection.Add(LegendCellType, String, ContentAlignment) 方法

定义

将具有指定单元格类型、文本和对齐方式的图例单元格添加到集合末尾。

public:
 int Add(System::Windows::Forms::DataVisualization::Charting::LegendCellType cellType, System::String ^ text, System::Drawing::ContentAlignment alignment);
public int Add(System.Windows.Forms.DataVisualization.Charting.LegendCellType cellType, string text, System.Drawing.ContentAlignment alignment);
override this.Add : System.Windows.Forms.DataVisualization.Charting.LegendCellType * string * System.Drawing.ContentAlignment -> int
Public Function Add (cellType As LegendCellType, text As String, alignment As ContentAlignment) As Integer

参数

cellType
LegendCellType

一个 LegendCellType 表示单元格类型的值。

text
String

表示 string 单元格文本或其图像名称的值,具体取决于参数的值 cellType 。

alignment
ContentAlignment

一个 ContentAlignment 表示单元格内容对齐方式的值。

返回

一个 integer 值,表示集合中新添加的图例单元格的索引。 索引从零开始。

适用于