DataGridTableStyle.ResetLinkColor 方法

定義

重設 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 方法來判斷屬性值是否已從預設值變更。

適用於

另請參閱