ToFormsColor

  <System.Runtime.CompilerServices.Extension()>
  Public Function ToFormsColor(color As Windows.Media.Color) As System.Drawing.Color
    Return System.Drawing.Color.FromArgb(color.A, color.R, color.G, color.B)
  End Function
Example:
ExampleWinFormsLabel.BackColor = MyWPFSolidColorBrush.Color.ToFormsColor

Description

Converts a System.Windows.Media.Color (WPF) into System.Drawing.Color (WinForms) In mixed projects using Windows-Forms and WPF, there is sometimes the need to convert colors between both.

Details

Double click on the code to select all.

 

;