문제

How can I find out if two brushes are equal

tColor1 = New BrushConverter().ConvertFrom("#FF89DE93")
tColor2 = New BrushConverter().ConvertFrom("#FF89DE93")
tColor3 = Brushes.LightGray

How can I compare these burshes and get true for tColor1 = tColor2 and false for tColor1 = tColor3?

도움이 되었습니까?

해결책

    Dim tColor1 As SolidColorBrush = CType(New BrushConverter().ConvertFrom("#FF89DE93"), SolidColorBrush)
    Dim tColor2 As SolidColorBrush = CType(New BrushConverter().ConvertFrom("#FF89DE93"), SolidColorBrush)
    Dim tColor3 = Brushes.LightGray

    Dim test As Boolean


    test = tColor1.Color = tColor2.Color 'True
    test = tColor1.Color = tColor3.Color 'False
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top