Search code examples
c#wpfwinformsxamlbackcolor

Set WinForms control BackColor with RGB in a WPF Application using XAML?


I've created a WinForms RichTextBox and I was able to change it's BackColor to any of the predefied colours using their names but I'm not able to specify the BackColor with RGB like so

<WindowsFormsHost>
    <wf:RichTextBox x:Name="body" BackColor="Color (13, 13, 17)">
    </wf:RichTextBox>
</WindowsFormsHost>

What's the right way to modify the colour of the WinForms control using RGB in XAML?


Solution

  • This question already exist, Here is a link to it :).

    Just a recap :

    <Label Text="Sea color" BackgroundColor="Aqua" />
    <Label Text="RGB" BackgroundColor="#00FF00" />
    <Label Text="Alpha plus RGB" BackgroundColor="#CC00FF00" />
    <Label Text="Tiny RGB" BackgroundColor="#0F0" />
    <Label Text="Tiny Alpha plus RGB" BackgroundColor="#C0F0" />