指定拆分器窗格的颜色

时间:2016-04-04 23:02:54

标签: c# devexpress

我想为窗格分割器指定颜色,这是我想要的颜色:#7FC6C8 我尝试它可以工作,但how can specify for this color和代码:

 @Html.DevExpress().Splitter(
        settings =>
        {
            settings.Name = "body";
            settings.Orientation = Orientation.Vertical;
            settings.FullscreenMode = true;
            settings.ShowCollapseBackwardButton = true;
            settings.SeparatorVisible = false;

            settings.Panes.Add(pane =>
            {
                pane.Name = "FirstSplitter";
                pane.Size = Unit.Pixel(85);


                ****pane.PaneStyle.BackColor = System.Drawing.Color.Red;****

                pane.Panes.Add(contentPane =>
                {
                    contentPane.PaneStyle.BorderTop.BorderWidth = Unit.Pixel(0);
                    contentPane.PaneStyle.BorderBottom.BorderWidth = Unit.Pixel(0);
                    contentPane.PaneStyle.BorderRight.BorderWidth = Unit.Pixel(0);
                    contentPane.PaneStyle.BorderLeft.BorderWidth = Unit.Pixel(0);

                    contentPane.Size = Unit.Percentage(8);

这项工作但是如何指定颜色#7FC6C8 :这项工作如何指定颜色** pane.PaneStyle.BackColor = System.Drawing.Color.Red; **谢谢你

1 个答案:

答案 0 :(得分:1)

在代码中定义自定义颜色,然后在设置BackColor时使用。所以#7FC6C8就是127,198,200。 7F = 127,C6 = 198且C8 = 200:

Color CustomColor = Color.FromArgb(127, 198, 200);
pane.PaneStyle.BackColor = CustomColor;