官方QQ:  16643506

关闭Dev控件的Ribbon窗体标题中的"Ribbon Display Options"(功能区显示选项)按钮

正常使用Ribbon窗体是有这个按钮的:


现在我们想去掉它,我们需要覆盖 Ribbon窗体的 GetFormBorderIcons 方法,代码如下:

 unit Unit3;

interface

uses
   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, 
   dxBar, dxRibbon, dxRibbonForm, dxRibbonSkins, cxGraphics, cxControls, cxLookAndFeels,
   cxLookAndFeelPainters, cxClasses, dxRibbonBackstageView, cxBarEditItem,
   dxRibbonCustomizationForm, cxTextEdit, cxContainer, cxEdit, dxSkinsForm,
   dxStatusBar, dxRibbonStatusBar, cxLabel, dxGallery, dxGalleryControl,
   dxRibbonBackstageViewGalleryControl, dxSkinsCore, dxSkinsDefaultPainters;

type
   TForm3 = class(TdxRibbonForm)
    dxBarManager1: TdxBarManager;
    dxBarManager1Bar1: TdxBar;
    dxRibbon1: TdxRibbon;
    dxRibbon1Tab1: TdxRibbonTab;
    dxRibbonBackstageView1: TdxRibbonBackstageView;
    dxRibbonBackstageViewTabSheet1: TdxRibbonBackstageViewTabSheet;
    dxRibbonStatusBar1: TdxRibbonStatusBar;
    dxRibbonBackstageViewGalleryControl1: TdxRibbonBackstageViewGalleryControl;
    cxLabel1: TcxLabel;
    dxRibbonBackstageViewGalleryControl1Group1: TdxRibbonBackstageViewGalleryGroup;
    dxSkinController1: TdxSkinController;
    dxRibbonBackstageViewGalleryControl1Group1Item1: TdxRibbonBackstageViewGalleryItem;
    dxBarManager1Bar2: TdxBar;
    cxBarEditItem1: TcxBarEditItem;
    procedure FormCreate(Sender: TObject);
   private
    { Private declarations }
   protected
    function GetFormBorderIcons: TdxRibbonBorderIcons; override;
   public
    { Public declarations }
   end;

var
   Form3: TForm3;

implementation

{$R *.dfm}

{ TForm3 }

procedure TForm3.FormCreate(Sender: TObject);
begin
   DisableAero := True;
end;

function TForm3.GetFormBorderIcons: TdxRibbonBorderIcons;
begin
   Result:= inherited GetFormBorderIcons - [rbiDisplayOptions];
end;

end.


最终效果如何:

联系电话:
020-00000000
联系电话:
020-00000000
联系电话:
020-12345678