Kod: Tümünü seç
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ComCtrls;
type
TForm1 = class(TForm)
PC1: TPageControl;
tab1: TTabSheet;
tab2: TTabSheet;
tab3: TTabSheet;
Button1: TButton;
Button2: TButton;
Button3: TButton;
Edit1: TEdit;
Label1: TLabel;
Label2: TLabel;
Edit2: TEdit;
Edit3: TEdit;
Label3: TLabel;
Label4: TLabel;
Edit4: TEdit;
Edit5: TEdit;
Label5: TLabel;
Label6: TLabel;
Edit6: TEdit;
procedure PC1Changing(Sender: TObject; var AllowChange: Boolean);
private
{ Private declarations }
public
{ Public declarations }
function KontrolTAB1 : Boolean;
function KontrolTAB2 : Boolean;
function KontrolTAB3 : Boolean;
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
function TForm1.KontrolTAB1 : Boolean;
begin
Result := (Edit1.Text = '') And (Edit2.Text = '');
end;
function TForm1.KontrolTAB2 : Boolean;
begin
Result := (Edit3.Text = '') And (Edit4.Text = '');
end;
function TForm1.KontrolTAB3 : Boolean;
begin
Result := (Edit5.Text = '') And (Edit6.Text = '');
end;
procedure TForm1.PC1Changing(Sender: TObject; var AllowChange: Boolean);
begin
case PC1.ActivePageIndex of
0 : AllowChange := KontrolTAB1;
1 : AllowChange := KontrolTAB2;
2 : AllowChange := KontrolTAB3;
end;
if Not AllowChange then
AllowChange := (MessageDlg('Sayfada değişiklik yapılmış, kaydetmek ister misiniz?', mtConfirmation, [mbYes, mbNo], 0) <> mrYes);
end;
end.
Kod: Tümünü seç
object Form1: TForm1
Left = 323
Top = 132
Width = 546
Height = 405
Caption = 'Form1'
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
OldCreateOrder = False
PixelsPerInch = 96
TextHeight = 13
object PC1: TPageControl
Left = 0
Top = 0
Width = 538
Height = 371
ActivePage = tab3
Align = alClient
TabOrder = 0
OnChanging = PC1Changing
object tab1: TTabSheet
Caption = 'Stok'
object Label1: TLabel
Left = 8
Top = 16
Width = 40
Height = 13
Caption = 'Ürün adı'
end
object Label2: TLabel
Left = 8
Top = 64
Width = 29
Height = 13
Caption = 'Miktar'
end
object Button1: TButton
Left = 288
Top = 304
Width = 227
Height = 25
Caption = 'Stok kartını kaydet'
TabOrder = 0
end
object Edit1: TEdit
Left = 8
Top = 32
Width = 121
Height = 21
TabOrder = 1
end
object Edit2: TEdit
Left = 8
Top = 80
Width = 121
Height = 21
TabOrder = 2
end
end
object tab2: TTabSheet
Caption = 'Cari'
ImageIndex = 1
object Label3: TLabel
Left = 112
Top = 96
Width = 43
Height = 13
Caption = 'Firma adı'
end
object Label4: TLabel
Left = 248
Top = 96
Width = 27
Height = 13
Caption = 'Yetkili'
end
object Button2: TButton
Left = 288
Top = 304
Width = 227
Height = 25
Caption = 'Cari kartını kaydet'
TabOrder = 0
end
object Edit3: TEdit
Left = 112
Top = 112
Width = 121
Height = 21
TabOrder = 1
end
object Edit4: TEdit
Left = 248
Top = 112
Width = 121
Height = 21
TabOrder = 2
end
end
object tab3: TTabSheet
Caption = 'Fatura'
ImageIndex = 2
object Label5: TLabel
Left = 8
Top = 16
Width = 47
Height = 13
Caption = 'Fatura no'
end
object Label6: TLabel
Left = 8
Top = 64
Width = 59
Height = 13
Caption = 'Fatura tarihi'
end
object Button3: TButton
Left = 288
Top = 304
Width = 227
Height = 25
Caption = 'Fatura kartını kaydet'
TabOrder = 0
end
object Edit5: TEdit
Left = 8
Top = 32
Width = 121
Height = 21
TabOrder = 1
end
object Edit6: TEdit
Left = 8
Top = 80
Width = 121
Height = 21
TabOrder = 2
end
end
end
end
