|
-
March 4th, 2004, 04:50 AM
#1
Deselecting text in CEdit
I have a dialog with a CEdit and a CSpinButtonCtrl.
This is my code:
void CInformDlg::OnDeltaposSpinLog(NMHDR* pNMHDR, LRESULT* pResult)
{
NM_UPDOWN* pNMUpDown = (NM_UPDOWN*)pNMHDR;
if (pNMUpDown->iDelta == -1) //Arriba
m_strLog = sText1;
else //Abajo
m_strLog = sText2;
m_editLog.SetSel(-1,-1);
UpdateData (FALSE);
*pResult = 0;
}
Where m_editLog is the edit and m_strLog is a CString variable associated with the edit. With this code, the text in CEdit is always selected, and I don't want this. What am I doing bad?
Thank you in advance.
I am Miss Maiden... Miss Iron Maiden :-D
-
March 4th, 2004, 04:56 AM
#2
Update your edit control manually...
Code:
void CInformDlg::OnDeltaposSpinLog(NMHDR* pNMHDR, LRESULT* pResult)
{
NM_UPDOWN* pNMUpDown = (NM_UPDOWN*)pNMHDR;
if (pNMUpDown->iDelta == -1) //Arriba
m_strLog = sText1;
else //Abajo
m_strLog = sText2;
UpdateData (FALSE);
m_editLog.SetSel(-1,-1);
m_editLog.UpdateWindow();
*pResult = 0;
}
-
March 4th, 2004, 05:30 AM
#3
Thank you Andreas. With your code happens the same. When the text is changed in my edit box (with spin control), all text is selected.
I am Miss Maiden... Miss Iron Maiden :-D
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|