Q&A

  • 고수들의 테크닉을 한수.....
한마디로 F1 키를 누를때와 마우스의 오른쪽버튼을 눌렀을때 조회폼이 나오게 하려는

아래의 복잡합을 간단하게 할수는 없을까요?



procedure TFAGAE0500.Enter_UpDown(Sender: TObject; var Key: Word;

Shift: TShiftState);

begin

case Key of

VK_F1 :

begin

if Sender = Edit_Bubin_Cd then

begin

Find_Cd := ''; Find_Nm := '';

if PopUpList(Find_Cd, Find_Nm, 'AA0100', '132', Edit_Bubin_Cd.Text, '00000000', '2') then

begin

Edit_Bubin_Cd.Text := Find_Cd;

Edit_Bubin_CdExit(Self);

if Edit_Bubin_Cd.Text <> '' then

Perform(WM_NextDlgCtl,0,0)

else

Edit_Bubin_Cd.SetFocus;

end;

end;

if Sender = Edit_Jiyuk then

begin

Find_Cd := ''; Find_Nm := '';

if PopUpList(Find_Cd, Find_Nm, 'AA3100', '1', Edit_Jiyuk.Text, '00000000', '10') then

begin

Edit_Jiyuk.Text := Find_Cd;

Edit_JiyukExit(Self);

if Edit_Jiyuk.Text <> '' then

Perform(WM_NextDlgCtl,0,0)

else

Edit_Jiyuk.SetFocus;

end;

end;

if Sender = Edit_Post then

begin

Find_Cd := '';

Find_Nm := '';

if PopUpList(Find_Cd, Find_Nm, 'AA0200', '', Edit_Post.Text, '00000000', '6') then

begin

Edit_Post.Text := Find_Cd;

Edit_Apt.Text := Find_Nm;

if Edit_Post.Text <> '' then

Perform(WM_NextDlgCtl,0,0)

else

Edit_Post.SetFocus;

end;

end;

if Sender = Edit_Tuk_Cd then

begin

Find_Cd := ''; Find_Nm := '';

if PopUpList(Find_Cd, Find_Nm, 'AA0100', '113', Edit_Tuk_Cd.Text, '00000000', '1') then

begin

Edit_Tuk_Cd.Text := Find_Cd;

Edit_Tuk_CdExit(Self);

if Edit_Tuk_Cd.Text <> '' then

Perform(WM_NextDlgCtl,0,0)

else

Edit_Tuk_Cd.SetFocus;

end;

end;

if Sender = Edit_Hang_Cd then

begin

Find_Cd := ''; Find_Nm := '';

if PopUpList(Find_Cd, Find_Nm, 'AA0100', '111', Edit_Hang_Cd.Text, '00000000', '3') then

begin

Edit_Hang_Cd.Text := Find_Cd;

Edit_Hang_CdExit(Self);

if Edit_Hang_Cd.Text <> '' then

Perform(WM_NextDlgCtl,0,0)

else

Edit_Hang_Cd.SetFocus;

end;

end;

end;

VK_RETURN :

begin

Perform(WM_NextDlgCtl,0,0);

Key:= 0;

end;

VK_DOWN :

begin

if Sender = ComboBox_Sgubun then

Exit;



Perform(WM_NextDlgCtl,0,0);

Key:= 0;

end;



VK_UP :

begin

if Sender = ComboBox_Sgubun then

Exit;



Perform(WM_NextDlgCtl,1,0);

Key:= 0;

end;

end;

end;





procedure TFAGAE0500.Mouse_PopUpList(Sender: TObject;

Button: TMouseButton; Shift: TShiftState; X, Y: Integer);

begin

if Button = mbRight then

begin

if Sender = Edit_Bubin_Cd then

begin

Edit_Bubin_Cd.SetFocus;

Find_Cd := '';

Find_Nm := '';

if PopUpList(Find_Cd, Find_Nm, 'AA0100', '132', Edit_Bubin_Cd.Text, '00000000', '2') then

begin

Edit_Bubin_Cd.Text := Find_Cd;

Edit_Bubin_CdExit(Self);

if Edit_Bubin_Cd.Text <> '' then

Perform(WM_NextDlgCtl,0,0)

else

Edit_Bubin_Cd.SetFocus;

end;

end;



if Sender = Edit_Jiyuk then

begin

Edit_Jiyuk.SetFocus;

Find_Cd := ''; Find_Nm := '';

if PopUpList(Find_Cd, Find_Nm, 'AA3100', '1', Edit_Jiyuk.Text, '00000000', '10') then

begin

Edit_Jiyuk.Text := Find_Cd;

Edit_JiyukExit(Self);

if Edit_Jiyuk.Text <> '' then

Perform(WM_NextDlgCtl,0,0)

else

Edit_Jiyuk.SetFocus;

end;

end;



if Sender = Edit_Post then

begin

Edit_Post.SetFocus;

Find_Cd := ''; Find_Nm := '';

if PopUpList(Find_Cd, Find_Nm, 'AA0200', '', Edit_Post.Text, '00000000', '6') then

begin

Edit_Post.Text := Find_Cd;

if Edit_Apt.Text = '' then

Edit_Apt.Text := Find_Nm;

if Edit_Post.Text <> '' then

Perform(WM_NextDlgCtl,0,0)

else

Edit_Post.SetFocus;

end;

end;



if Sender = Edit_Tuk_Cd then

begin

Edit_Tuk_Cd.SetFocus;

Find_Cd := ''; Find_Nm := '';

if PopUpList(Find_Cd, Find_Nm, 'AA0100', '113', Edit_Tuk_Cd.Text, '00000000', '1') then

begin

Edit_Tuk_Cd.Text := Find_Cd;

Edit_Tuk_CdExit(Self);

if Edit_Tuk_Cd.Text <> '' then

Perform(WM_NextDlgCtl,0,0)

else

Edit_Tuk_Cd.SetFocus;

end;

end;



if Sender = Edit_Hang_Cd then

begin

Edit_Hang_Cd.SetFocus;

Find_Cd := ''; Find_Nm := '';

if PopUpList(Find_Cd, Find_Nm, 'AA0100', '111', Edit_Hang_Cd.Text, '00000000', '3') then

begin

Edit_Hang_Cd.Text := Find_Cd;

Edit_Hang_CdExit(Self);

if Edit_Hang_Cd.Text <> '' then

Perform(WM_NextDlgCtl,0,0)

else

Edit_Hang_Cd.SetFocus;

end;

end;

end;

end;





이벤트에서 이벤트를 호출하면 되것같은데... 모르겠네요,....

답변은 소스로 해주셨으면 감사하겠습니다.

0  COMMENTS