Delphi 仿制用友U8界面
- unit Unit1;
- interface
- uses
- Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
- Vcl.Controls, Vcl.Forms, Vcl.Dialogs, cxGraphics, cxControls, cxLookAndFeels,
- cxLookAndFeelPainters, dxSkinsCore, dxSkinsDefaultPainters,
- dxSkinsdxNavBarPainter, dxSkinscxPCPainter, cxPCdxBarPopupMenu, cxPC,
- dxNavBarCollns, cxClasses, dxNavBarBase, dxNavBar, dxSkinsdxStatusBarPainter,
- dxStatusBar;
- type
- TForm1 = class(TForm)
- dxNavBar1: TdxNavBar;
- dxNavBar1Group1: TdxNavBarGroup;
- dxNavBar1Group2: TdxNavBarGroup;
- dxNavBar1Group3: TdxNavBarGroup;
- dxNavBar1Group4: TdxNavBarGroup;
- dxNavBar1Item1: TdxNavBarItem;
- dxNavBar1Item2: TdxNavBarItem;
- dxNavBar1Item3: TdxNavBarItem;
- dxNavBar1Item4: TdxNavBarItem;
- cxPageControl1: TcxPageControl;
- cxTabSheet1: TcxTabSheet;
- dxStatusBar1: TdxStatusBar;
- Procedure Addpage(cText:String);
- procedure dxNavBar1Item1Click(Sender: TObject);
- procedure dxNavBar1Item2Click(Sender: TObject);
- procedure dxNavBar1Item3Click(Sender: TObject);
- procedure dxNavBar1Item4Click(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
- var
- Form1: TForm1;
- implementation
- {$R *.dfm}
- Procedure TForm1.Addpage(cText:String);
- Var
- I:integer;
- bNew:Boolean;
- TempTab:TcxTabSheet;
- begin
- bNew:=true;
- for I := 0 to Self.cxPageControl1.PageCount-1 do
- begin
- if cxpageControl1.Pages[i].Caption=cText then
- begin
- cxpagecontrol1.Properties.ActivePage:=cxpagecontrol1.Pages[i];
- bNew:=False;
- end;
- end;
- IF bNew then
- begin
- TempTab:=TcxTabSheet.Create(cxpageControl1);
- TempTab.Caption:=cText;
- TempTab.PageControl:=cxpageControl1;
- cxPageControl1.Properties.ActivePage:=TempTab;
- end;
- end;
- procedure TForm1.dxNavBar1Item1Click(Sender: TObject);
- begin
- Addpage((Sender as TdxNavBarItem).Caption);
- end;
- procedure TForm1.dxNavBar1Item2Click(Sender: TObject);
- begin
- Addpage((Sender as TdxNavBarItem).Caption);
- end;
- procedure TForm1.dxNavBar1Item3Click(Sender: TObject);
- begin
- Addpage((Sender as TdxNavBarItem).Caption);
- end;
- procedure TForm1.dxNavBar1Item4Click(Sender: TObject);
- begin
- Addpage((Sender as TdxNavBarItem).Caption);
- end;
- end.
来源:http://www.cnblogs.com/wuxi15/p/3805638.html
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。