How to provent text selection in CComboBox ?
-
I have an CComboBoxExt derived from CCOmboBox .. but I have an small problem , perhaps you can help me :
CComboBoxExt m\_Combo;
void CTestComboView::OnInitialUpdate()
{
CFormView::OnInitialUpdate();
GetParentFrame()->RecalcLayout();
ResizeParentToFit();m\_Combo.AddString("One"); m\_Combo.AddString("Two"); m\_Combo.AddString("Three");
}
and when I type 'O' in combobox , it select me automatically 'One' item from the list ... well , I try this one :
void CComboBoxExt::OnEditupdate()
{
// TODO: Add your control notification handler code hereCString sText; GetWindowText(sText); DWORD dwCurSel = GetEditSel(); WORD dStart = LOWORD(dwCurSel); WORD dEnd = HIWORD(dwCurSel); if(dStart == 0 && dEnd == sText.GetLength()) SetEditSel(sText.GetLength(),sText.GetLength());
}
but have no effect ....
-
I have an CComboBoxExt derived from CCOmboBox .. but I have an small problem , perhaps you can help me :
CComboBoxExt m\_Combo;
void CTestComboView::OnInitialUpdate()
{
CFormView::OnInitialUpdate();
GetParentFrame()->RecalcLayout();
ResizeParentToFit();m\_Combo.AddString("One"); m\_Combo.AddString("Two"); m\_Combo.AddString("Three");
}
and when I type 'O' in combobox , it select me automatically 'One' item from the list ... well , I try this one :
void CComboBoxExt::OnEditupdate()
{
// TODO: Add your control notification handler code hereCString sText; GetWindowText(sText); DWORD dwCurSel = GetEditSel(); WORD dStart = LOWORD(dwCurSel); WORD dEnd = HIWORD(dwCurSel); if(dStart == 0 && dEnd == sText.GetLength()) SetEditSel(sText.GetLength(),sText.GetLength());
}
but have no effect ....
I forget to say something : I use this , may me this cause weird behaviour ?
void CComboBoxExt::OnEditchange()
{
// TODO: Add your control notification handler code hereCString sText; GetWindowText(sText); if(sText.IsEmpty())ShowDropDown(FALSE); else ShowDropDown();
}
-
I have an CComboBoxExt derived from CCOmboBox .. but I have an small problem , perhaps you can help me :
CComboBoxExt m\_Combo;
void CTestComboView::OnInitialUpdate()
{
CFormView::OnInitialUpdate();
GetParentFrame()->RecalcLayout();
ResizeParentToFit();m\_Combo.AddString("One"); m\_Combo.AddString("Two"); m\_Combo.AddString("Three");
}
and when I type 'O' in combobox , it select me automatically 'One' item from the list ... well , I try this one :
void CComboBoxExt::OnEditupdate()
{
// TODO: Add your control notification handler code hereCString sText; GetWindowText(sText); DWORD dwCurSel = GetEditSel(); WORD dStart = LOWORD(dwCurSel); WORD dEnd = HIWORD(dwCurSel); if(dStart == 0 && dEnd == sText.GetLength()) SetEditSel(sText.GetLength(),sText.GetLength());
}
but have no effect ....
mesajflaviu wrote:
...but I have an small problem...
Which is? :confused: You've shown code, but have failed to explain what is supposed to happen vs. what is actually happening.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
-
mesajflaviu wrote:
...but I have an small problem...
Which is? :confused: You've shown code, but have failed to explain what is supposed to happen vs. what is actually happening.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
The problem is that when I type 'O' , the control autocompletion 'One' in editbox , select all text and put the mouse cursor at the end of the 'One' string .. is annoynig , because I want to type myself all string ... for more details , I put here[^] an source code .. .just type 'O' in combobox ....