设置devexpress PopupColorEdit颜色

时间:2019-04-18 21:56:11

标签: wpf devexpress

我想通过代码将颜色设置为PopupColorEdit,在xaml中,它的工作方式如下:

<dxe:PopupColorEdit  Color="#FFE5E5E5" x:Name="gridTopCP" HorizontalAlignment="Left" Margin="61,10,0,0" VerticalAlignment="Top" Width="150"/> 

但是,如果我尝试通过代码进行设置:

     Private Sub button_Click(sender As Object, e As RoutedEventArgs) Handles button.Click
    Dim boja As Color = Color.FromArgb(Convert.ToInt32("#FFE5E5E5", 16))
    gridTopCP.Color = boja
End Sub

我收到错误消息:Value of type 'Color' cannot be converted to 'Color'

1 个答案:

答案 0 :(得分:0)

ColorEdit.Color = Color.FromRgb(150, 18, 30);

您需要传递RGB值而不是HTML代码,您会找到RGB values