Click here to Skip to main content
15,900,724 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Http Request Pin
San246815-Nov-07 5:10
San246815-Nov-07 5:10 
GeneralRe: Http Request Pin
led mike15-Nov-07 5:25
led mike15-Nov-07 5:25 
Questionchanging the cursor postion in a editable combobox??? Pin
SnaKeBeD15-Nov-07 3:39
SnaKeBeD15-Nov-07 3:39 
AnswerRe: changing the cursor postion in a editable combobox??? Pin
DoomedOne15-Nov-07 5:34
DoomedOne15-Nov-07 5:34 
GeneralRe: changing the cursor postion in a editable combobox??? Pin
Deepu Antony15-Nov-07 7:45
Deepu Antony15-Nov-07 7:45 
GeneralRe: changing the cursor postion in a editable combobox??? Pin
SnaKeBeD15-Nov-07 7:49
SnaKeBeD15-Nov-07 7:49 
QuestionRe: changing the cursor postion in a editable combobox??? Pin
David Crow15-Nov-07 8:42
David Crow15-Nov-07 8:42 
GeneralRe: changing the cursor postion in a editable combobox??? Pin
DoomedOne15-Nov-07 9:45
DoomedOne15-Nov-07 9:45 
try this, it work for me.
In a MFC dialog app , add a ComboBox, add a control variable m_Combo1 for it.
in the CBN_EDITCHANGE message map the metod: OnCombo1EditChange
In the body copy the folowing code

<br />
void CMFC1Dlg::OnCombo1EditChange()<br />
{<br />
   // Here you should do or call the process to look for text on the DB <br />
   // and modify the ComboBox item list and text <br />
   <br />
   //for this examle<br />
   //Here I get the text entered and compare it whit a fixed text "New"<br />
   //If the user entered "New" and not exists the item "New Element" in<br />
   //the combo list, I add de element<br />
   //then select the "New Element" item as the current selected item<br />
   // Set the cursor at the end of the element<br />
   // <br />
   // For a real use, I think, is better select the text since the <br />
   // last entered character to the end of the text<br />
   // <br />
   CString UserText;<br />
   TCHAR AddText[12] = _T("New Element");<br />
   CWnd * pEdit = m_Combo1.GetWindow( GW_CHILD ); <br />
   ASSERT( pEdit );<br />
   pEdit->GetWindowText(UserText);<br />
   if ( UserText.Compare(_T("New"))==0)<br />
   {<br />
      if (m_Combo1.FindString(-1,&AddText[0])==CB_ERR ) <br />
      {<br />
         m_Combo1.AddString(&AddText[0]);<br />
         m_Combo1.SetCurSel(m_Combo1.FindString(-1,&AddText[0]));<br />
      }<br />
      int tLen = m_Combo1.GetLBTextLen(m_Combo1.GetCurSel());<br />
      m_Combo1.SetEditSel(tLen,tLen); <br />
   }<br />
}<br />
<br />

//Note CMFC1Dlg is the class for the dialog

Or take a look at:

http://www.codeproject.com/combobox/combocompletion.asp
GeneralRe: changing the cursor postion in a editable combobox??? Pin
chandu00415-Nov-07 21:05
chandu00415-Nov-07 21:05 
GeneralRe: changing the cursor postion in a editable combobox??? Pin
Nelek15-Nov-07 23:46
protectorNelek15-Nov-07 23:46 
GeneralRe: changing the cursor postion in a editable combobox??? Pin
chandu00416-Nov-07 20:55
chandu00416-Nov-07 20:55 
GeneralRe: changing the cursor postion in a editable combobox??? Pin
Nelek19-Nov-07 21:39
protectorNelek19-Nov-07 21:39 
GeneralRe: changing the cursor postion in a editable combobox??? Pin
SnaKeBeD16-Nov-07 4:33
SnaKeBeD16-Nov-07 4:33 
GeneralRe: changing the cursor postion in a editable combobox??? Pin
DoomedOne16-Nov-07 6:53
DoomedOne16-Nov-07 6:53 
QuestionHow can block a Messenger packet....? Pin
jomons15-Nov-07 2:24
jomons15-Nov-07 2:24 
GeneralRe: How can block a Messenger packet....? Pin
Matthew Faithfull15-Nov-07 4:06
Matthew Faithfull15-Nov-07 4:06 
Questionneed help with c programming data validation Pin
neodeaths15-Nov-07 2:17
neodeaths15-Nov-07 2:17 
GeneralRe: need help with c programming data validation Pin
Matthew Faithfull15-Nov-07 2:24
Matthew Faithfull15-Nov-07 2:24 
GeneralRe: need help with c programming data validation Pin
neodeaths15-Nov-07 4:33
neodeaths15-Nov-07 4:33 
GeneralRe: need help with c programming data validation Pin
DoomedOne15-Nov-07 5:01
DoomedOne15-Nov-07 5:01 
QuestionMDI without Doc/view Pin
CodeMak15-Nov-07 1:30
CodeMak15-Nov-07 1:30 
AnswerRe: MDI without Doc/view Pin
Nelek15-Nov-07 1:35
protectorNelek15-Nov-07 1:35 
GeneralRe: MDI without Doc/view Pin
CodeMak15-Nov-07 1:39
CodeMak15-Nov-07 1:39 
GeneralRe: MDI without Doc/view Pin
CodeMak15-Nov-07 1:44
CodeMak15-Nov-07 1:44 
GeneralRe: MDI without Doc/view Pin
Nelek15-Nov-07 3:03
protectorNelek15-Nov-07 3:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.