how can i functional m_my combo box?
What I have tried:
void CnewprojectmengaeView::OnInitialUpdate()
{
CView::OnInitialUpdate();
m_myCombo.Create(WS_CHILD | WS_VISIBLE | CBS_SIMPLE | WS_VSCROLL,
CRect(1200, 600, 1300, 750), this, 7);
m_myCombo.InsertString(0, _T("View"));
m_myCombo.InsertString(1, _T("Move"));
m_myCombo.InsertString(2, _T("Stop"));
m_myCombo.InsertString(3, _T("Exit"));
void CnewprojectmengaeView::Onm_myCombo()
{
if (m_myCombo.GetCurSel() == 0)
{
CClientDC dc(this);
CBrush brush_black(RGB(0, 0, 0));
dc.FillRect(CRect(130, 171, 170, 180),
&brush_black);
SetTimer(1, 30, NULL);
}
if (m_myCombo.GetCurSel() == 1)
{
CClientDC dc(this);
CBrush brush_black(RGB(0, 0, 0));
CBrush brush_white(RGB(255, 255, 255));
dc.FillRect(CRect(X1, 171, X1 - 20, 180), &brush_black);
dc.FillRect(CRect(X1 - 40, 171, X1 - 20, 180), &brush_white);
X1++;
SetTimer(1, 30, NULL);
}
if (m_myCombo.GetCurSel() == 2)
{
X1--;
}
if (m_myCombo.GetCurSel() == 3)
{
exit(0);
}
SetTimer(1, 30, NULL);
}