Question

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?

Was it helpful?

Solution

    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
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top