簡體   English   中英

Devexpress Checkbutton 藍線邊框 - 如何刪除

[英]Devexpress Checkbutton Blueline border - how to remove

我目前正在開發一個 devexpress 項目,並且正在使用checkbutton工具。 我讓它做我想做的一切,除了出現在appearance.hover上的非常煩人的病態藍線。hover 和appearance.pressed .按下。

如果有的話,我希望有一種與主題相匹配的顏色,但無論選擇什么皮膚,藍線總是很煩人,感覺就像舊的 html 設計。

我已經嘗試設置bordercolor ,但仍然如此。

以下是我迄今為止嘗試過的代碼form.Designer.cs

this.cBtnFilter.AllowFocus = false;
this.cBtnFilter.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.cBtnFilter.AppearanceDisabled.Options.UseBackColor = true;
this.cBtnFilter.AppearanceHovered.BorderColor = System.Drawing.Color.White;
this.cBtnFilter.AppearanceHovered.Options.UseBackColor = true;
this.cBtnFilter.AppearanceHovered.Options.UseBorderColor = true;
this.cBtnFilter.AppearancePressed.BorderColor = System.Drawing.Color.White;
this.cBtnFilter.AppearancePressed.Options.UseBackColor = true;
this.cBtnFilter.AppearancePressed.Options.UseBorderColor = true;
this.cBtnFilter.ImageOptions.AllowGlyphSkinning = DevExpress.Utils.DefaultBoolean.False;
this.cBtnFilter.ImageOptions.Location = DevExpress.XtraEditors.ImageLocation.MiddleCenter;
this.cBtnFilter.ImageOptions.SvgImage = global::form.Properties.Resources.icon_filter;
this.cBtnFilter.ImageOptions.SvgImageSize = new System.Drawing.Size(40, 40);
this.cBtnFilter.Location = new System.Drawing.Point(355, 40);
this.cBtnFilter.LookAndFeel.SkinName = "The Bezier";
this.cBtnFilter.LookAndFeel.Style = DevExpress.LookAndFeel.LookAndFeelStyle.UltraFlat;
this.cBtnFilter.LookAndFeel.UseDefaultLookAndFeel = false;
this.cBtnFilter.Name = "cBtnFilter";
this.cBtnFilter.PaintStyle = DevExpress.XtraEditors.Controls.PaintStyles.Light;
this.cBtnFilter.ShowFocusRectangle = DevExpress.Utils.DefaultBoolean.False;
this.cBtnFilter.Size = new System.Drawing.Size(50, 50);
toolTipTitleItem4.Text = "Show active Only";
superToolTip4.Items.Add(toolTipTitleItem4);
this.cBtnFilter.SuperTip = superToolTip4;
this.cBtnFilter.TabIndex = 39;
this.cBtnFilter.Click += new System.EventHandler(this.Filter_Click);

所附圖像分別是選擇時和懸停時的示例。

至少如果我可以完全刪除藍線或將其更改為主題顏色。 那會很好。

我正在使用 Devexpress 版本 20.2.4

在此處輸入圖像描述

我解決這個問題的方法是使用簡單的按鈕,讓它像一個切換按鈕。

此方法為我處理切換

public Boolean buttonState = false;

private void ToggleButton()
        {
            if (buttonState)
            {
                simpleButton.Appearance.BackColor = Color.Red;
                buttonState = false;
            }
            else
            {
                simpleButton.Appearance.BackColor = Color.White;
                buttonState = true;
            }
        }

這是按鈕

private void simpleButton_Click(object sender, EventArgs e)
{
    ToggleButton();
}

這是Designer.cs中的按鈕

this.simpleButton1.AllowFocus = false;
this.simpleButton1.AppearanceHovered.BackColor = System.Drawing.Color.Teal;
this.simpleButton1.AppearanceHovered.Options.UseBackColor = true;
this.simpleButton1.Location = new System.Drawing.Point(524, 214);
this.simpleButton1.LookAndFeel.SkinName = "The Bezier";
this.simpleButton1.LookAndFeel.UseDefaultLookAndFeel = false;
this.simpleButton1.Name = "simpleButton1";
this.simpleButton1.ShowFocusRectangle = DevExpress.Utils.DefaultBoolean.False;
this.simpleButton1.Size = new System.Drawing.Size(157, 150);
this.simpleButton1.TabIndex = 2;
this.simpleButton1.Text = "simpleButton";
this.simpleButton1.Click += new System.EventHandler(this.simpleButton1_Click);

它非常簡單。 如果有人有更好的方法或需要此方法,請將自己(ves)淘汰出局。

希望在未來,Devexpress 不會強加給我們藍色邊框。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM