DataGrid.CaptionText 屬性

定義

取得或設定方格的視窗標題文字。

public:
 property System::String ^ CaptionText { System::String ^ get(); void set(System::String ^ value); };
public string CaptionText { get; set; }
member this.CaptionText : string with get, set
Public Property CaptionText As String

屬性值

String

顯示為方格視窗標題的字串。 預設為空字串 ("")。

範例

下列程式碼範例會設定 的 System.Windows.Forms.DataGrid 標題。

if ( dataGrid1->CaptionText == "" )
{
   dataGrid1->CaptionText = "Microsoft DataGrid";
}
if(dataGrid1.CaptionText == "")
dataGrid1.CaptionText = "Microsoft DataGrid";
If DataGrid1.CaptionText = "" Then
    DataGrid1.CaptionText = "Microsoft DataGrid"
End If

適用於

另請參閱