https://docs.devexpress.com/VCL/158024/ExpressPageControl/glossary/custom-buttons?v=21.2
最终效果图
01]每个面页Tab添加关闭按钮02]每个面页Tab前面添加图标
03] 面页Tab多了,自动添加导航条
04]添加Go下拉按钮
05]右上角添加自定义按钮
06]新增页面按钮
01]每个面页Tab添加关闭按钮
02]每个面页Tab前面添加图标
03] 面页Tab多了,自动添加导航条
cxProperties的Multiline必须设为False.
04]添加Go下拉按钮
03导航条要可见。Options中的pcoGoDialog 要设为True.
设置按钮图标
添加按钮事件
06]新增页面按钮
06a]显示 新增按钮
会有
06b]添加图标使之变大
procedure TForm1.FormCreate(Sender: TObject);
begin
cxPageControl1.Properties.NewButton.ImageIndex:=1; //设置图标使之变大
end;
06c]新页面添加文字
procedure TForm1.Pa(aa: TObject);
begin
showmessage('asdf');
end;
procedure TForm1.cxPageControl1NewTabCreate(Sender: TObject; AIndex: Integer);
begin
cxPageControl1.Pages[AIndex].Caption:='新页面'; //设定新页面文字
cxPageControl1.Pages[AIndex].ImageIndex:=1; //设定图标
Button1 := TButton.Create(Self);
Button1.Caption:='动态创建的按钮';
Button1.OnClick := Pa; //绑定事情响应函数,如果有的话,只要参数 类型 一样,数量一样即可。要是Form1的实际 函数过程
Button1.Left := 100;
Button1.Top := 50;
Button1.Parent := cxPageControl1.Pages[AIndex];
end;