maintain focus in edit box
-
How do i maintain the focus in a edit box? For example i was typing half-way in the edit box, however an event occur and the focus got changed. How do i set the focus to remain in the edit box. This is wat i tried to do when the event occurs
if(m_alarmOn==false) { m_alarmOn= true; CWnd* prev = this->SetFocus(); prev->SetFocus(); CreateThread(0,NULL,CSecurityDlg::playSound,this,0,0); }
The above code reside in a OnBtnClick function. So when alarm is on, the button will be auto click....and the alarm sound goes off.... But in the process of these, i might be typing in a editbox. So i will lose the focus...How do i get it to stay? :(( Aaron -
How do i maintain the focus in a edit box? For example i was typing half-way in the edit box, however an event occur and the focus got changed. How do i set the focus to remain in the edit box. This is wat i tried to do when the event occurs
if(m_alarmOn==false) { m_alarmOn= true; CWnd* prev = this->SetFocus(); prev->SetFocus(); CreateThread(0,NULL,CSecurityDlg::playSound,this,0,0); }
The above code reside in a OnBtnClick function. So when alarm is on, the button will be auto click....and the alarm sound goes off.... But in the process of these, i might be typing in a editbox. So i will lose the focus...How do i get it to stay? :(( Aaron -
void APPDlg::OnKillfocusTextBox() { //set condtion here to see if the user has finshed typing.. //else do this, m_TextBox.SetFocus(); } u can never get out of ur textbox if u dont handle it correctly :~ V