Kodlar aşağıdadır.
KES03.PRG den(1. FORM) "ARA" TUŞUNA basılarak KES04.PRG(2.FORM) çağrılıyor.
KES04.PRG de işimiz bitince "ÇIKIŞ "TUŞUNA basılıyor.
AMA SADECE KES04.PRG(FORM2) den çıkılacağına 1 FORMDAN da çıkılıyor.
2. FORMU(EKRANI) kapatıp 1. FORMA(EKRANA) geçmem için kodlarda nasıl bir değişiklik yapmam gerekiyor ?
Teşekkürler.
KES03.PRG
-------------------------------
CLOSE ALL
SET TALK OFF
SET NOTIFY OFF
ON ERROR DO HATA
Public oForm
oForm = Createobject("acente1")
oForm.Show(1)
Define Class acente1 As Form
DataSession = 2
Top = 2
Left = 50
Height = 450
Width = 515
Name = "acente1"
Caption = "Boya Stok Kartı"
Icon = "BLUE.ico"
orecord = .Null.
Add Object lblno As Label With ;
left = 5, Top = 5, Caption = "Boya No :", AutoSize=.T.
Add Object lbladi As Label With ;
left = 5, Top = 30, Caption = "Boya Adı :", AutoSize=.T.
Add Object lblmin As Label With ;
left = 5, Top = 55, Caption = "Min.Adet :", AutoSize=.T.
Add Object txtNo As myTextBox With ;
Top = 2, ;
left = 95, ;
Width = 35, ;
BackColor = 65535, ;
InputMask = "999", ;
Enabled = .F.
Add Object txtAdi As myTextBox With ;
Top = 27, ;
left = 95, ;
Width = 225, ;
BackColor = 65535, ;
InputMask = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", ;
Enabled = .F.
Add Object txtmin As myTextBox With ;
Top = 52, ;
left = 95, ;
Width = 85, ;
BackColor = 65535, ;
InputMask = "9999,999.99", ;
Enabled = .F.
Add Object cmdNew as CommandButton With ;
Top = 2, ;
Left = 415, ;
Height = 27, ;
Width = 84, ;
Caption = 'Yeni Kayıt', ;
Enabled = .t.
Add Object cmdSave as CommandButton With ;
Top = 2, ;
Left = 415, ;
Height = 27, ;
Width = 84, ;
Caption = 'Kaydet', ;
Visible = .f.
Add Object cmdSave2 as CommandButton With ;
Top = 2, ;
Left = 415, ;
Height = 27, ;
Width = 84, ;
Caption = 'Kaydet', ;
Visible = .f.
Add Object cmdEdit as CommandButton With ;
Top = 32, ;
Left = 415, ;
Height = 27, ;
Width = 84, ;
Caption = 'Düzenle', ;
Enabled = .t.
Add Object cmdAra as CommandButton With ;
Top = 32, ;
Left = 315, ;
Height = 27, ;
Width = 84, ;
Caption = 'Ara', ;
Enabled = .t.
Add Object cmdCancel as CommandButton With ;
Top = 32, ;
Left = 415, ;
Height = 27, ;
Width = 84, ;
Caption = 'İptal', ;
Visible = .f.
Add Object cmdUpdate as CommandButton With ;
Top = 32, ;
Left = 415, ;
Height = 27, ;
Width = 84, ;
Caption = 'Kayıt', ;
Visible = .f.
Add Object cmdDelete as CommandButton With ;
Top = 62, ;
Left = 415, ;
Height = 27, ;
Width = 84, ;
Caption = 'Sil', ;
Enabled = .t.
Add Object cmdClose as CommandButton With ;
Top = 92, ;
Left = 415, ;
Height = 27, ;
Width = 84, ;
Caption = 'Çıkış'
Add Object cmdkodu as CommandButton With ;
Top = 152, ;
Left = 415, ;
Height = 27, ;
Width = 84, ;
Caption = 'No'
Add Object cmdadi as CommandButton With ;
Top = 182, ;
Left = 415, ;
Height = 27, ;
Width = 84, ;
Caption = 'Adı'
Add Object grdListe as myGrid
Procedure cmdNew.Click
ppNew()
EndProc
Procedure cmdSave.Click
ppSave()
EndProc
Procedure cmdSave2.Click
ppSave2()
EndProc
Procedure cmdCancel.Click
ppCancel()
EndProc
Procedure cmdEdit.Click
ppEdit()
EndProc
Procedure cmdAra.Click
ppAra()
EndProc
Procedure cmdDelete.Click
ppDelete()
EndProc
Procedure cmdClose.Click
thisform.Release
EndProc
Procedure cmdkodu.Click
ppkodu()
EndProc
Procedure cmdadi.Click
ppadi()
EndProc
Procedure Load
SET TALK OFF
SET NOTIFY OFF
SET DELE ON
SET ESCAPE OFF
SET ECHO OFF
SET TALK OFF
SET DATE TO BRITI
SET CENT ON
set safe off
SELE 1
USE boya INDEX boya1,boya2
SELE 99
USE log INDEX log1
SELE 1
Endproc
Enddefine
******************************************************************
Define Class myTextBox as TextBox
******************************************************************
Enabled = .f.
DisabledForeColor = Rgb(0,0,0)
SelectOnEntry = .t.
EndDefine
******************************************************************
Procedure ppNew
******************************************************************
With oForm
EndWith
EndProc
******************************************************************
Procedure ppSave
******************************************************************
With oForm
EndWith
EndProc
******************************************************************
Procedure ppSave2
******************************************************************
With oForm
EndWith
EndProc
******************************************************************
Procedure ppCancel
******************************************************************
With oForm
EndWith
EndProc
******************************************************************
Procedure ppEdit
******************************************************************
With oForm
EndWith
EndProc
******************************************************************
Procedure ppAra
******************************************************************
With oForm
DO KES04
EndWith
EndProc
******************************************************************
Procedure ppDelete
******************************************************************
With oForm
EndWith
EndProc
******************************************************************
Procedure ppkodu
******************************************************************
With oForm
EndWith
EndProc
******************************************************************
Procedure ppadi
******************************************************************
With oForm
EndWith
EndProc
******************************************************************
Define Class myGrid as Grid
******************************************************************
* Top = 62
Top = 85
Left = 2
Height = 355
Width = 400
ColumnCount = 3
DeleteMark = .F.
RecordMark = .t.
ReadOnly = .T.
RecordSource = "boya"
ScrollBars = 3
GridLineColor = Rgb(192,192,192)
Procedure Init
With this
.Column1.Header1.Caption = 'Sıra'
.Column1.Width = 35
.Column1.ControlSource = "boya.no"
.Column2.Header1.Caption = 'Adı'
.Column2.Width = 250
.Column2.ControlSource = "boya.adi"
.Column3.Header1.Caption = 'Min.Adet'
.Column3.Width = 80
.Column3.InputMask = "9999,999.99"
.Column3.ControlSource = "boya.min"
EndWith
this.SetAll('Enabled',.f.,'textbox')
this.SetAll('DisabledForeColor',0,'textbox')
EndProc
Procedure AfterRowColChange
Lparameters nColIndex
DoDefault(nColIndex)
With oForm
.txtno.Value = No
.txtadi.Value = Adi
.txtMin.Value = Min
EndWith
Thisform.Refresh()
EndProc
EndDefine
-------------------------------
KES04.PRG
-------------------------------
CLOSE ALL
SET TALK OFF
SET NOTIFY OFF
ON ERROR DO HATA
Public oForm
oForm = Createobject("acente2")
oForm.Show(1)
Define Class acente2 As Form
DataSession = 2
Top = 2
Left = 50
Height = 450
Width = 515
Name = "acente2"
Caption = "Vernik Stok Kartı"
Icon = "BLUE.ico"
orecord = .Null.
Add Object lblno As Label With ;
left = 5, Top = 5, Caption = "Vernik No :", AutoSize=.T.
Add Object lbladi As Label With ;
left = 5, Top = 30, Caption = "Vernik Adı :", AutoSize=.T.
Add Object lblmin As Label With ;
left = 5, Top = 55, Caption = "Min.Adet :", AutoSize=.T.
Add Object txtNo As myTextBox With ;
Top = 2, ;
left = 95, ;
Width = 35, ;
BackColor = 65535, ;
InputMask = "999", ;
Enabled = .F.
Add Object txtAdi As myTextBox With ;
Top = 27, ;
left = 95, ;
Width = 225, ;
BackColor = 65535, ;
InputMask = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", ;
Enabled = .F.
Add Object txtmin As myTextBox With ;
Top = 52, ;
left = 95, ;
Width = 85, ;
BackColor = 65535, ;
InputMask = "9999,999.99", ;
Enabled = .F.
Add Object cmdNew as CommandButton With ;
Top = 2, ;
Left = 415, ;
Height = 27, ;
Width = 84, ;
Caption = 'Yeni Kayıt', ;
Enabled = .t.
Add Object cmdSave as CommandButton With ;
Top = 2, ;
Left = 415, ;
Height = 27, ;
Width = 84, ;
Caption = 'Kaydet', ;
Visible = .f.
Add Object cmdSave2 as CommandButton With ;
Top = 2, ;
Left = 415, ;
Height = 27, ;
Width = 84, ;
Caption = 'Kaydet', ;
Visible = .f.
Add Object cmdEdit as CommandButton With ;
Top = 32, ;
Left = 415, ;
Height = 27, ;
Width = 84, ;
Caption = 'Düzenle', ;
Enabled = .t.
Add Object cmdCancel as CommandButton With ;
Top = 32, ;
Left = 415, ;
Height = 27, ;
Width = 84, ;
Caption = 'İptal', ;
Visible = .f.
Add Object cmdUpdate as CommandButton With ;
Top = 32, ;
Left = 415, ;
Height = 27, ;
Width = 84, ;
Caption = 'Kayıt', ;
Visible = .f.
Add Object cmdDelete as CommandButton With ;
Top = 62, ;
Left = 415, ;
Height = 27, ;
Width = 84, ;
Caption = 'Sil', ;
Enabled = .t.
Add Object cmdClose as CommandButton With ;
Top = 92, ;
Left = 415, ;
Height = 27, ;
Width = 84, ;
Caption = 'Çıkış'
Add Object cmdkodu as CommandButton With ;
Top = 152, ;
Left = 415, ;
Height = 27, ;
Width = 84, ;
Caption = 'No'
Add Object cmdadi as CommandButton With ;
Top = 182, ;
Left = 415, ;
Height = 27, ;
Width = 84, ;
Caption = 'Adı'
Add Object grdListe as myGrid
Procedure cmdNew.Click
ppNew()
EndProc
Procedure cmdSave.Click
ppSave()
EndProc
Procedure cmdSave2.Click
ppSave2()
EndProc
Procedure cmdCancel.Click
ppCancel()
EndProc
Procedure cmdEdit.Click
ppEdit()
EndProc
Procedure cmdDelete.Click
ppDelete()
EndProc
Procedure cmdClose.Click
thisform.Release
EndProc
Procedure cmdkodu.Click
ppkodu()
EndProc
Procedure cmdadi.Click
ppadi()
EndProc
Procedure Load
SET TALK OFF
SET NOTIFY OFF
SET DELE ON
SET ESCAPE OFF
SET ECHO OFF
SET TALK OFF
SET DATE TO BRITI
SET CENT ON
set safe off
SELE 1
USE Vernik INDEX Vernik1,Vernik2
SELE 99
USE log INDEX log1
SELE 1
Endproc
Enddefine
******************************************************************
Define Class myTextBox as TextBox
******************************************************************
Enabled = .f.
DisabledForeColor = Rgb(0,0,0)
SelectOnEntry = .t.
EndDefine
******************************************************************
Procedure ppNew
******************************************************************
With oForm
EndWith
EndProc
******************************************************************
Procedure ppSave
******************************************************************
With oForm
EndWith
EndProc
******************************************************************
Procedure ppSave2
******************************************************************
With oForm
EndWith
EndProc
******************************************************************
Procedure ppCancel
******************************************************************
With oForm
EndWith
EndProc
******************************************************************
Procedure ppEdit
******************************************************************
With oForm
EndWith
EndProc
******************************************************************
Procedure ppDelete
******************************************************************
With oForm
EndWith
EndProc
******************************************************************
Procedure ppkodu
******************************************************************
With oForm
EndWith
EndProc
******************************************************************
Procedure ppadi
******************************************************************
With oForm
EndWith
EndProc
******************************************************************
Define Class myGrid as Grid
******************************************************************
Top = 85
Left = 2
Height = 355
Width = 400
ColumnCount = 3
DeleteMark = .F.
RecordMark = .t.
ReadOnly = .T.
RecordSource = "Vernik"
ScrollBars = 3
GridLineColor = Rgb(192,192,192)
Procedure Init
With this
.Column1.Header1.Caption = 'Sıra'
.Column1.Width = 35
.Column1.ControlSource = "Vernik.no"
.Column2.Header1.Caption = 'Adı'
.Column2.Width = 250
.Column2.ControlSource = "Vernik.adi"
.Column3.Header1.Caption = 'Min.Adet'
.Column3.Width = 80
.Column3.InputMask = "9999,999.99"
.Column3.ControlSource = "Vernik.min"
EndWith
this.SetAll('Enabled',.f.,'textbox')
this.SetAll('DisabledForeColor',0,'textbox')
EndProc
Procedure AfterRowColChange
Lparameters nColIndex
DoDefault(nColIndex)
With oForm
.txtno.Value = No
.txtadi.Value = Adi
.txtMin.Value = Min
EndWith
Thisform.Refresh()
EndProc
EndDefine
-------------------------------