?? ypdj.pas
字號:
end;
application.MessageBox('保存成功','提示',64);
editclear;
close;
except
application.MessageBox('保存失敗','提示',64);
end;
end;
procedure Typdjfrm.SpeedButton5Click(Sender: TObject);
begin
if messagebox(self.Handle,'真的要刪除嗎?','提示',mb_yesno+mb_iconquestion)=idyes then
data.ADOQuery1.Delete;
end;
procedure Typdjfrm.SpeedButton7Click(Sender: TObject);
begin
editclear;
end;
procedure Typdjfrm.SpeedButton6Click(Sender: TObject);
begin
close;
end;
procedure Typdjfrm.FormCreate(Sender: TObject);
begin
if mainfrm.log=1 then
begin
if data.ypdj.FieldByName('編號').Value<>null then
begin
ComboBox2.Clear;
ComboBox3.Clear;
editvalue;
SpeedButton3.Visible:=true;
SpeedButton2.Visible:=true;
SpeedButton5.Visible:=true;
SpeedButton1.Visible:=false;
SpeedButton4.Visible:=false;
SpeedButton7.Visible:=false;
SpeedButton3.Left:=ypdjfrm.SpeedButton1.Left;
SpeedButton2.Left:=ypdjfrm.SpeedButton4.Left;
SpeedButton5.Left:=ypdjfrm.SpeedButton7.Left;
SpeedButton3.Top:=ypdjfrm.SpeedButton1.Top;
SpeedButton2.Top:=ypdjfrm.SpeedButton4.Top;
SpeedButton5.Top:=ypdjfrm.SpeedButton7.Top;
end;
end;
end;
procedure Typdjfrm.Edit1Change(Sender: TObject);
begin
if (edit1.Text<>'') and (edit2.Text<>'') and (combobox1.Text<>'') and
(combobox2.Text<>'') and (memo1.Text<>'') and (edit3.Text<>'') and
(edit4.Text<>'') and (edit5.Text<>'') and (edit6.Text<>'') and
(edit7.Text<>'') and (edit8.Text<>'') and (edit9.Text<>'') then
SpeedButton4.Enabled:=true;
end;
procedure Typdjfrm.Edit2Change(Sender: TObject);
begin
if (edit1.Text<>'') and (edit2.Text<>'') and (combobox1.Text<>'') and
(combobox2.Text<>'') and (memo1.Text<>'') and (edit3.Text<>'') and
(edit4.Text<>'') and (edit5.Text<>'') and (edit6.Text<>'') and
(edit7.Text<>'') and (edit8.Text<>'') and (edit9.Text<>'') and (combobox1.Text<>'') then
SpeedButton4.Enabled:=true;
end;
procedure Typdjfrm.Edit3Change(Sender: TObject);
begin
if (edit1.Text<>'') and (edit2.Text<>'') and (combobox1.Text<>'') and
(combobox2.Text<>'') and (memo1.Text<>'') and (edit3.Text<>'') and
(edit4.Text<>'') and (edit5.Text<>'') and (edit6.Text<>'') and
(edit7.Text<>'') and (edit8.Text<>'') and (edit9.Text<>'') and (combobox1.Text<>'')then
SpeedButton4.Enabled:=true;
end;
procedure Typdjfrm.Edit4Change(Sender: TObject);
begin
if (edit1.Text<>'') and (edit2.Text<>'') and (combobox1.Text<>'') and
(combobox2.Text<>'') and (memo1.Text<>'') and (edit3.Text<>'') and
(edit4.Text<>'') and (edit5.Text<>'') and (edit6.Text<>'') and
(edit7.Text<>'') and (edit8.Text<>'') and (edit9.Text<>'') and (combobox1.Text<>'')then
SpeedButton4.Enabled:=true;
end;
procedure Typdjfrm.Edit5Change(Sender: TObject);
begin
if (edit1.Text<>'') and (edit2.Text<>'') and (combobox1.Text<>'') and
(combobox2.Text<>'') and (memo1.Text<>'') and (edit3.Text<>'') and
(edit4.Text<>'') and (edit5.Text<>'') and (edit6.Text<>'') and
(edit7.Text<>'') and (edit8.Text<>'') and (edit9.Text<>'') and (combobox1.Text<>'')then
SpeedButton4.Enabled:=true;
end;
procedure Typdjfrm.Edit6Change(Sender: TObject);
begin
if (edit1.Text<>'') and (edit2.Text<>'') and (combobox1.Text<>'') and
(combobox2.Text<>'') and (memo1.Text<>'') and (edit3.Text<>'') and
(edit4.Text<>'') and (edit5.Text<>'') and (edit6.Text<>'') and
(edit7.Text<>'') and (edit8.Text<>'') and (edit9.Text<>'') and (combobox1.Text<>'')then
SpeedButton4.Enabled:=true;
end;
procedure Typdjfrm.Edit7Change(Sender: TObject);
begin
if (edit1.Text<>'') and (edit2.Text<>'') and (combobox1.Text<>'') and
(combobox2.Text<>'') and (memo1.Text<>'') and (edit3.Text<>'') and
(edit4.Text<>'') and (edit5.Text<>'') and (edit6.Text<>'') and
(edit7.Text<>'') and (edit8.Text<>'') and (edit9.Text<>'') and (combobox1.Text<>'')then
SpeedButton4.Enabled:=true;
end;
procedure Typdjfrm.Edit8Change(Sender: TObject);
begin
if (edit1.Text<>'') and (edit2.Text<>'') and (combobox1.Text<>'') and
(combobox2.Text<>'') and (memo1.Text<>'') and (edit3.Text<>'') and
(edit4.Text<>'') and (edit5.Text<>'') and (edit6.Text<>'') and
(edit7.Text<>'') and (edit8.Text<>'') and (edit9.Text<>'') and (combobox1.Text<>'')then
SpeedButton4.Enabled:=true;
end;
procedure Typdjfrm.Edit9Change(Sender: TObject);
begin
if (edit1.Text<>'') and (edit2.Text<>'') and (combobox1.Text<>'') and
(combobox2.Text<>'') and (memo1.Text<>'') and (edit3.Text<>'') and
(edit4.Text<>'') and (edit5.Text<>'') and (edit6.Text<>'') and
(edit7.Text<>'') and (edit8.Text<>'') and (edit9.Text<>'') and (combobox1.Text<>'')then
SpeedButton4.Enabled:=true;
end;
procedure Typdjfrm.Memo1Change(Sender: TObject);
begin
if (edit1.Text<>'') and (edit2.Text<>'') and (combobox1.Text<>'') and
(combobox2.Text<>'') and (memo1.Text<>'') and (edit3.Text<>'') and
(edit4.Text<>'') and (edit5.Text<>'') and (edit6.Text<>'') and
(edit7.Text<>'') and (edit8.Text<>'') and (edit9.Text<>'') and (combobox1.Text<>'')then
SpeedButton4.Enabled:=true;
end;
procedure Typdjfrm.Edit1KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if (Key = vk_Return) or(Key = vk_Down) then
Edit2.SetFocus;
end;
procedure Typdjfrm.Edit2KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if ((Key = vk_Return) or(Key = vk_Down)) then
combobox1.SetFocus
else
if Key = vk_Up then
Edit1.SetFocus;
end;
procedure Typdjfrm.Edit3KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if ((Key = vk_Return) or(Key = vk_Down)) then
edit4.SetFocus
else
if Key = vk_Up then
maskedit1.SetFocus;
end;
procedure Typdjfrm.Edit4KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if ((Key = vk_Return) or(Key = vk_Down)) then
edit5.SetFocus
else
if Key = vk_Up then
edit3.SetFocus;
end;
procedure Typdjfrm.Edit5KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if ((Key = vk_Return) or(Key = vk_Down)) then
edit6.SetFocus
else
if Key = vk_Up then
edit4.SetFocus;
end;
procedure Typdjfrm.Edit6KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if ((Key = vk_Return) or(Key = vk_Down)) then
edit7.SetFocus
else
if Key = vk_Up then
edit5.SetFocus;
end;
procedure Typdjfrm.Edit7KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if ((Key = vk_Return) or(Key = vk_Down)) then
edit8.SetFocus
else
if Key = vk_Up then
edit6.SetFocus;
end;
procedure Typdjfrm.Edit8KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if ((Key = vk_Return) or(Key = vk_Down)) then
edit9.SetFocus
else
if Key = vk_Up then
edit7.SetFocus;
end;
procedure Typdjfrm.Edit9KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if ((Key = vk_Return) or(Key = vk_Down)) then
combobox3.SetFocus
else
if Key = vk_Up then
edit8.SetFocus;
end;
procedure Typdjfrm.ComboBox1KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if Key = vk_Return then
combobox2.SetFocus
else
if Key = vk_Up then
edit2.SetFocus;
end;
procedure Typdjfrm.ComboBox2KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if Key = vk_Return then
maskedit1.SetFocus
else
if Key = vk_Up then
combobox1.SetFocus;
end;
procedure Typdjfrm.ComboBox3KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if Key = vk_Return then
memo1.SetFocus
else
if Key = vk_Up then
edit9.SetFocus;
end;
procedure Typdjfrm.MaskEdit1KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if ((Key = vk_Return) or(Key = vk_Down)) then
edit3.SetFocus
else
if Key = vk_Up then
combobox2.SetFocus;
end;
procedure Typdjfrm.Memo1KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if Key = vk_Down then
memo2.SetFocus
else
if Key = vk_Up then
combobox3.SetFocus;
end;
procedure Typdjfrm.Memo2KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if mainfrm.log=1 then
begin
if ((Key = vk_Return) or(Key = vk_Down)) then
if Key = vk_Up then
memo1.SetFocus
end
else
begin
if speedbutton4.Enabled=true then
if Key = vk_Down then
if Key = vk_Up then
memo1.SetFocus;
end;
end;
end.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -