unit TabDis; interface usesSysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, TabNotBk; typeTFrmTabDis = class(TForm)TabbedNotebook1: TTabbedNotebook;Button1: TButton;procedure FormCreate(Sender: TObject);procedure Button1Click(Sender: TObject);private{ Private-Deklarationen }public{ Public-Deklarationen }end; varFrmTabDis: TFrmTabDis; implementation {$R *.DFM} procedure TFrmTabDis.FormCreate(Sender: TObject);vari: integer;j: integer;begin{ Создаем имена для всех Notebook TTabButton } j := 0; with TabbedNotebook1 dofor i := 0 to ControlCount - 1 doif Controls[i].ClassName = 'TTabButton' then beginControls[i].Name := Controls[i].ClassName + IntToStr(j);Inc(j);end;end; procedure TFrmTabDis.Button1Click(Sender: TObject);begin{ Делаем недоступной определенную страницу notebook }with TControl(TabbedNotebook1.FindComponent('TTabButton2')) doEnabled := not Enabled;end; end. |
- Ralph Friedman [000952]