tabbuttons.pas
上传用户:hylc_2004
上传日期:2014-01-23
资源大小:46800k
文件大小:2k
源码类别:

Delphi控件源码

开发平台:

Delphi

  1. unit tabbuttons;
  2. interface
  3. uses
  4.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  5.   Db, DBTables, StdCtrls, fcLabel, ExtCtrls, fcClearPanel, fcButtonGroup,
  6.   ComCtrls, fcButton, fcImgBtn;
  7. type
  8.   TTabBtnGroupForm = class(TForm)
  9.     PageControl1: TPageControl;
  10.     TabSheet1: TTabSheet;
  11.     TabSheet2: TTabSheet;
  12.     Shape1: TShape;
  13.     fcButtonGroup1: TfcButtonGroup;
  14.     fcButtonGroup1fcImageBtn1: TfcImageBtn;
  15.     fcButtonGroup1fcImageBtn2: TfcImageBtn;
  16.     fcButtonGroup1fcImageBtn3: TfcImageBtn;
  17.     fcButtonGroup1fcImageBtn4: TfcImageBtn;
  18.     fcButtonGroup1fcImageBtn5: TfcImageBtn;
  19.     fcButtonGroup1fcImageBtn6: TfcImageBtn;
  20.     fcButtonGroup1fcImageBtn7: TfcImageBtn;
  21.     fcLabel1: TfcLabel;
  22.     fcLabel2: TfcLabel;
  23.     fcLabel3: TfcLabel;
  24.     TabSheet3: TTabSheet;
  25.     TabSheet4: TTabSheet;
  26.     TabSheet5: TTabSheet;
  27.     fcLabel4: TfcLabel;
  28.     fcLabel5: TfcLabel;
  29.     fcLabel6: TfcLabel;
  30.     TabSheet6: TTabSheet;
  31.     TabSheet7: TTabSheet;
  32.     fcLabel7: TfcLabel;
  33.     fcLabel8: TfcLabel;
  34.     procedure fcButtonGroup1Change(ButtonGroup: TfcCustomButtonGroup;
  35.       OldSelected, Selected: TfcButtonGroupItem);
  36.     procedure FormShow(Sender: TObject);
  37.   private
  38.     { Private declarations }
  39.   public
  40.     { Public declarations }
  41.   end;
  42. var
  43.   TabBtnGroupForm: TTabBtnGroupForm;
  44. implementation
  45. {$R *.DFM}
  46. procedure TTabBtnGroupForm.fcButtonGroup1Change(ButtonGroup: TfcCustomButtonGroup;
  47.   OldSelected, Selected: TfcButtonGroupItem);
  48. begin
  49.    PageControl1.ActivePage :=
  50.       (FindComponent('TabSheet'+IntToStr(Selected.Button.Tag)) as TTabSheet);
  51. end;
  52. procedure TTabBtnGroupForm.FormShow(Sender: TObject);
  53. begin
  54.   PageControl1.ActivePage := TabSheet1;
  55. end;
  56. end.