CodePudding user response:
Increase the size combobox dropdown width height directionCodePudding user response:
Is not like that, I want to through the button to open the folder dialog box, select a file, the file name is added to the inside of the combobox edit box without adding to the drop-down box!CodePudding user response:
M_combo. SetWindowText (choose);//to the combo of editCodePudding user response:
The great god, can you write a specific//combo to editCodePudding user response:
M_combo. SetWindowText (),CodePudding user response:
CFileDialog DLG (TRUE, ""," ", NULL, "");
If (DLG) DoModal ()==IDOK)
{
Cstrings STR=DLG. GetPathName ();
CComboBox * comb=(CComboBox *) GetDlgItem (IDC_COMBO1);
Comb - & gt; AddString (_T (STR));
Int count=comb - & gt; GetCount ();
Comb - & gt; SetCurSel (count - 1);
}
I write so, m_combo SetWindowText () plus, it's no use the
CodePudding user response:
Your m_combo. SetWindowText () of the code is written in the book?CodePudding user response:
I added but useless, I may not know where, shielding those? Can you help me change it, thank youCodePudding user response:
CFileDialog DLG (TRUE, ""," ", NULL, "");
If (DLG) DoModal ()==IDOK)
{
Cstrings STR=DLG. GetPathName ();
CComboBox * comb=(CComboBox *) GetDlgItem (IDC_COMBO1);
ASSERT (NULL!=comb - & gt; GetSafeHwnd ());
Combo - & gt; SetWindowText (STR);
}
CodePudding user response:
SetLBTextCodePudding user response:
Set after the UpdateData (FALSE); Have a tryCodePudding user response:
CFileDialog DLG (TRUE, ""," ", NULL, "");If (DLG) DoModal ()==IDOK)
{
Cstrings STR=DLG. GetPathName ();
CComboBox * comb=(CComboBox *) GetDlgItem (IDC_COMBO1);
ASSERT (NULL!=comb - & gt; GetSafeHwnd ());
Comb - & gt; SetWindowText (STR);
}
I run for a moment, or not to display content in combobox edit box!
Set after the UpdateData (FALSE); It's nothing, and SetLBText is what?
CodePudding user response:
Void CxxxxDlg: : OnButton1 (){
//TODO: Add your the control notification handler code here
CFileDialog DLG (TRUE);//, ""," ", NULL, "");
If (DLG) DoModal ()==IDOK)
{
Cstrings STR=DLG. GetPathName ();
CComboBox * pComb=(CComboBox *) GetDlgItem (IDC_COMBO1);
ASSERT (NULL!=pComb - & gt; GetSafeHwnd ());
PComb - & gt; SetWindowText (STR);
}
}
No problem on vc6
CodePudding user response:
Ok, I'm vs2010, I in a moment, thank you!CodePudding user response:
AddString must be added in the drop-down list,To the ordinary reality, when it is edit box, SetWindowText enough,