:: MVP ::
|
|
:: RSS ::
|
|
|
Как в TdxTabbedMDIManager выделить заголовок активного таба жирным шрифтом?
uses
{...,} cxPC, dxTabbedMDI;
type
TcxTabControlProperties = class(cxPC.TcxCustomTabControlProperties)
published
property OnDrawTabEx;
end;
TForm1 = class(TForm)
dxTabbedMDIManager1: TdxTabbedMDIManager;
procedure FormShow(Sender: TObject);
private
procedure DrawTabExEvent(AControl: TcxCustomTabControlProperties;
ATab: TcxTab; Font: TFont);
end;
implementation
procedure TForm1.FormShow(Sender: TObject);
begin
TcxTabControlProperties(dxTabbedMDIManager1.TabProperties).OnDrawTabEx := DrawTabExEvent;
end;
procedure TForm1.DrawTabExEvent(AControl: TcxCustomTabControlProperties;
ATab: TcxTab; Font: TFont);
begin
if Assigned(dxTabbedMDIManager1.TabProperties.ActivePage) then
if ATab.Index = dxTabbedMDIManager1.TabProperties.ActivePage.Index then
Font.Style := Font.Style + [fsBold];
end;
|
Как в TdxTabbedMDIManager убрать кнопку закрытия с определенной вкладки?
uses
{...,} cxPC, dxTabbedMDI;
type
TcxTabControlProperties = class(cxPC.TcxCustomTabControlProperties)
published
property OnDrawTabEx;
end;
TForm1 = class(TForm)
dxTabbedMDIManager1: TdxTabbedMDIManager;
procedure FormShow(Sender: TObject);
private
procedure DrawTabExEvent(AControl: TcxCustomTabControlProperties;
ATab: TcxTab; Font: TFont);
end;
implementation
procedure TForm1.FormShow(Sender: TObject);
begin
TcxTabControlProperties(dxTabbedMDIManager1.TabProperties).OnDrawTabEx := DrawTabExEvent;
end;
procedure TForm1.DrawTabExEvent(AControl: TcxCustomTabControlProperties;
ATab: TcxTab; Font: TFont);
begin
// Убираем унопку с первой вкладки при
// dxTabbedMDIManager.TabProperties.CloseButtonMode =
// cbmActiveAndHoverTabs, cbmActiveTab, cbmEveryTab
if ATab.Index = 0 then
ATab.AllowCloseButton := False;
end;
|
Как узнать количество вкладок в TdxTabbedMDIManager?
// Способ первый
procedure TForm1.Button1Click(Sender: TObject);
begin
ShowMessage(dxTabbedMDIManager1.ViewInfo.TabsViewInfo.Tabs.Count.ToString);
end;
// Способ второй
procedure TForm1.Button1Click(Sender: TObject);
begin
ShowMessage(dxTabbedMDIManager1.ViewInfo.TabsViewInfo.ViewInfoCount.ToString);
end;
|
При использовании материала - ссылка на сайт обязательна
|
|