DataGridTableStyle.ResetLinkColor 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
重設 LinkColor 屬性為其預設值。
public:
void ResetLinkColor();
public void ResetLinkColor ();
member this.ResetLinkColor : unit -> unit
Public Sub ResetLinkColor ()
範例
下列程式碼範例示範此成員的使用。
// String variable used to show message.
String^ myString = "Link color changed from: ";
// Store current foreground color of selected cells.
Color myCurrentColor = myDataGridTableStyle->LinkColor;
myString = String::Concat( myString, myCurrentColor );
// Reset link color to default.
myDataGridTableStyle->ResetLinkColor();
myString = String::Concat( myString, " to " );
myString = String::Concat( myString, myDataGridTableStyle->LinkColor );
// Show information about changes in color setting.
MessageBox::Show( myString, "Link line color information" );
// String variable used to show message.
string myString = "Link color changed from: ";
// Store current foreground color of selected cells.
Color myCurrentColor = myDataGridTableStyle.LinkColor;
myString += myCurrentColor.ToString();
// Reset link color to default.
myDataGridTableStyle.ResetLinkColor();
myString += " to ";
myString += myDataGridTableStyle.LinkColor.ToString();
// Show information about changes in color setting.
MessageBox.Show(myString, "Link line color information");
' String variable used to show message.
Dim myString As String = "Link color changed from: "
' Store current foreground color of selected cells.
Dim myCurrentColor As Color = myDataGridTableStyle.LinkColor
myString += myCurrentColor.ToString()
' Reset link color to default.
myDataGridTableStyle.ResetLinkColor()
myString += " to "
myString += myDataGridTableStyle.LinkColor.ToString()
' Show information about changes in color setting.
MessageBox.Show(myString, "Link line color information")
備註
如果您要為 DataGridTableStyle 建立 設計工具,或建立自己的控制項併入 DataGridTableStyle ,您通常會使用這個方法。 您可以使用 ShouldSerializeLinkColor 方法來判斷屬性值是否已從預設值變更。