Sorry for my poor English
I have created a simple project. My program load some image from my local computer and display it in a list control. I add a delete button to delete image if user choose an image in list control.
But when I choose more than 1 image, delete button is disappeared. Anybody help me?
Thanks a lot.
[Update]
Here is the way I handle event. But when I press control and choose more than 1 image, delete button is disappeared
void OnBnClickedBtnDeleteBase()
{
int msgboxID = MessageBox(
L"Do you want to delete selected image?",
L"Delete image",
MB_ICONWARNING | MB_YESNO | MB_DEFBUTTON2);
switch (msgboxID)
{
case IDYES:
DeleteSeletedBase();
break;
case IDNO:
break;
}
}
[Update]
Sorry! Problem is not in the upper code.
The problem is here:
if( pNMListView->uNewState & LVIS_SELECTED )
{
m_btnDeleteBase.EnableWindow(TRUE);
}
else
m_btnDeleteBase.EnableWindow(FALSE);
So anybody can tell me, how can I choose multiple item :(. I am not very good at c++
Anhybody know about iItem variable :( is it useful? I tried but nothing happens :(
[Another update]
If you use
Collapse
if( (pNMListView->uNewState & LVIS_SELECTED) || (pNMListView->uNewState & LVIS_FOCUSED))
{
m_btnDeleteBase.EnableWindow(TRUE);
}
You can choose more than 1 items. But in some cases, delete button is still disable Frown | :( Anybody help me?