|
SetFocuse() 를 쓰지 마시고
ActiveControl = Serial_Edit;
와 같이
ActiveControl을 지정해보세요..
돗대리아 님이 쓰신 글 :
: TEdit 에서 엔터키 입력되면 해당 포커스로 이동을 할려는대요...
:
: CLPositon1, CLPositon2 까지는 잘 이동 됩니다.
:
: 문제는 Serial 쪽으로 이동 할려니 않되는군요..
:
: ShowMessage를 한번 띄우고 메인폼으로 오면 포커스가 Serial 로 이동 되구요..
:
: 이건 FormActivate 에서 포커스 이동을 했기 때문에 되는것 같은대요
:
: Enter를 입력하여 이동하는 부분은 않되네요...
:
: 아래 소스가 문제가 있는지요??
:
: //---------------------------------------------------------------------------
: // Main Form Activate Function
: //---------------------------------------------------------------------------
: void __fastcall TMain_Form::FormActivate(TObject *Sender)
: {
: if(!Main_Form->Serial_Edit->Focused()) Main_Form->Serial_Edit->SetFocus();
: mFormActive = true;
: }
: //---------------------------------------------------------------------------
: void __fastcall TMain_Form::Serial_EditKeyPress(TObject *Sender, char &Key)
: {
: if(Key == 13) CLPosition1_Edit -> SetFocus();
: }
: //---------------------------------------------------------------------------
: // CL Position1 Edit Enter Inspection
: //---------------------------------------------------------------------------
: void __fastcall TMain_Form::CLPosition1_EditKeyPress(TObject *Sender, char &Key)
: {
: if(Key == 13) CLPosition2_Edit -> SetFocus();
: }
: //---------------------------------------------------------------------------
: // CL Position2 Edit Enter Inspection
: //---------------------------------------------------------------------------
: void __fastcall TMain_Form::CLPosition2_EditKeyPress(TObject *Sender, char &Key)
: {
: if(Key == 13) Serial_Edit -> SetFocus();
: }
|