Bonjour ymca2003
Le mesage "ON_CBN_SELCHANGE(AFX_IDW_TOOLBAR + 1,ComboUtilisateurSelect)" est traité dans la classe CMainframe
La CComboxEx est declaré dans la classe CNewToolbar.
class CNewToolBar : public CToolBar
{
DECLARE_DYNAMIC(CNewToolBar)
public:
CNewToolBar();
virtual ~CNewToolBar();
CComboBoxEx m_wndUtilisateur;
....
Et m_wndToolBar est declaré dans CMainframe
CNewToolBar m_wndToolBar;
Je la creer de cette maniere:
if(! m_wndToolBar.m_wndUtilisateur.Create(CBS_DROPDOWNLIST | CBS_SORT | WS_VISIBLE |WS_TABSTOP | WS_VSCROLL, rect,)&m_wndToolBar, AFX_IDW_TOOLBAR + 1)
{
TRACE(_T("Failed to create combo-box\n"));
return FALSE;
}
Les valeur sont correctement inserrée dans "m_wndUtilisateur"
avec la fonction Charge_Utilisateur();
La fonction ComboUtilisateurSelect() est correctement traitée
mais "string" reste vide.
CString string est declaré dans CMainframe.
void CMainFrame::ComboUtilisateurSelect()
{
UpdateData(true);
//Charge_Utilisateur();
m_wndToolBar.m_wndUtilisateur.GetWindowText(string);
/*m_wndToolBar.m_wndUtilisateur.GetLBText(m_wndUtilisateur.GetCurSel(),string);*/
}
