|
//---------------------------------------------------------------------------
void __fastcall TForm2::Edit1KeyPress(TObject *Sender, wchar_t &Key)
{
if(Key==13) Edit2->SetFocus();
Key = 0;
}
//---------------------------------------------------------------------------
void __fastcall TForm2::Edit2KeyPress(TObject *Sender, wchar_t &Key)
{
if(Key==13) Edit3->SetFocus();
Key = 0;
}
//---------------------------------------------------------------------------
void __fastcall TForm2::Edit3KeyPress(TObject *Sender, wchar_t &Key)
{
if(Key==13) Edit1->SetFocus();
Key = 0;
}
//---------------------------------------------------------------------------
잘 되는 군요...
돗대리아 님이 쓰신 글 :
: 답변 감사합니다.
:
: 새로운걸 하나 알게 됬습니다.
:
: 허나 그렇게 해봐도 포커스 이동이 않되는군요....ㅠㅠ
:
: if(!Serial_Edit -> Focused()) Serial_Edit -> SetFocus();
:
: 위의 방식대로 해봐도 이동이 않되구요....ㅠㅠ
:
: Object Inspector 에서 설정하는 부분에 먼가가 있는건지 의문입니다.
:
: Object Inspector 설정부분이 Serial Edit에대한 틀린 부분이 있는지 확인 한번 해주실수 있나요???
:
: AutoSelect -> true;
: AutoSize -> true
: Enabled -> true
: ImeMode -> imDontCare
: OEMConvert -> false
: ParentBiDiMode -> false
: ReadOnly -> false
: TabOrder -> 3
: TabStop -> true
: Visible -> true
:
:
: 둘리.CSIEDA 님이 쓰신 글 :
: : 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();
: : : }
|