DataRepeater.SelectionColor 屬性
取得或設定顯示的項目標頭中的色彩DataRepeater控制當第一次選取的項目。
命名空間: Microsoft.VisualBasic.PowerPacks
組件: Microsoft.VisualBasic.PowerPacks.Vs (在 Microsoft.VisualBasic.PowerPacks.Vs.dll 中)
語法
'宣告
Public Property SelectionColor As Color
public Color SelectionColor { get; set; }
public:
property Color SelectionColor {
Color get ();
void set (Color value);
}
member SelectionColor : Color with get, set
function get SelectionColor () : Color
function set SelectionColor (value : Color)
屬性值
類型:Color
要使用的色彩。預設為 Highlight。
備註
SelectionColor套用時,才DataRepeaterItem具有焦點。 當項目中的控制項具有焦點時,項目標頭色彩將會與相同BackColor。
![]() |
---|
如果您設定SelectionColor至White,選取項目符號時,無法顯示選取的項目。 |
範例
下列範例示範如何變更選取範圍色彩配置中的變更的回應。
Private Sub DataRepeater1_LayoutStyleChanged(
) Handles DataRepeater1.LayoutStyleChanged
' Set the SelectionColor based on orientation.
If DataRepeater1.LayoutStyle =
PowerPacks.DataRepeaterLayoutStyles.Vertical Then
DataRepeater1.SelectionColor = Drawing.Color.Blue
Else
DataRepeater1.SelectionColor = Drawing.Color.Red
End If
End Sub
private void dataRepeater1_LayoutStyleChanged(object sender, System.EventArgs e)
{
// Set the SelectionColor based on orientation.
if (dataRepeater1.LayoutStyle == DataRepeaterLayoutStyles.Vertical)
{
dataRepeater1.SelectionColor = System.Drawing.Color.Blue;
}
else
{
dataRepeater1.SelectionColor = System.Drawing.Color.Red;
}
}
.NET Framework 安全性
- 完全信任立即呼叫者。這個成員無法供部分信任的程式碼使用。如需詳細資訊,請參閱從部分受信任程式碼使用程式庫。
請參閱
參考
Microsoft.VisualBasic.PowerPacks 命名空間