@R_403_323@
简而言之,是的. MSDN覆盖它
here.问题是它不是通过Color完成的 – 你需要处理BGR设置的值 – 即每个整数由颜色组成00BBGGRR,所以你左移蓝色16,绿色8,并使用红色“按原样”.
我的VB糟透了,但在C#中添加紫色:
using (ColorDialog dlg = new ColorDialog()) { Color purple = Color.Purple; int i = (purple.B << 16) | (purple.G << 8) | purple.R; dlg.CustomColors = new[] { i }; dlg.ShowDialog(); }
反射器向我保证这类似于:
Using dlg As ColorDialog = New ColorDialog Dim purple As Color = Color.Purple Dim i As Integer = (((purple.B << &H10) Or (purple.G << 8)) Or purple.R) dlg.CustomColors = New Integer() { i } dlg.ShowDialog End Using