【问题标题】:Set WinForms control BackColor with RGB in a WPF Application using XAML?使用 XAML 在 WPF 应用程序中使用 RGB 设置 WinForms 控件 BackColor?
【发布时间】:2019-01-01 07:14:20
【问题描述】:

我创建了一个 WinForms RichTextBox,并且能够使用它们的名称将其 BackColor 更改为任何预定义的颜色,但我无法像这样使用 RGB 指定 BackColor p>

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

XAML中使用RGB修改WinForms控件颜色的正确方法是什么?

【问题讨论】:

    标签: c# wpf winforms xaml backcolor


    【解决方案1】:

    这个问题已经存在,Here is a link to it :)。

    只是一个回顾:

    <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" />
    

    【讨论】:

    • 实际上它在任何地方都不存在,因为我要求 WinForms。顺便说一句,您的回答对我有所帮助,因为我不知道 Hex 颜色会在 WinForms 控件上起作用! +1 我就是这样做的BackColor="#0D0D11"
    • 很高兴能帮上忙。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-04-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-10-14
    相关资源
    最近更新 更多