how to show a button after move it?
-
I have a button on a list, something like whenever you select a row, move the button to that row. So I implement this in OnLvnItemchangedList event:
void CMyDlg::OnLvnItemchangedList(NMHDR *pNMHDR, LRESULT *pResult)
{
...
// canculate the rec by seleted row
CRect rec;
...// move button
m_myBtn.MoveWindow(rec);
m_myBtn.ShowWindow(SW_SHOW);
m_myBtn.BringWindowToTop();InvalidateRect(rec);
m_myBtn.RedrawWindow();}
It works, but I cannot see the button. :confused::confused: If the mouse moves over the button, it shows then I can see it. I don't know why, maybe there's something wrong in my last two source code rows. Can anyone explain how to solve this?? Thank you in advance !!
-
I have a button on a list, something like whenever you select a row, move the button to that row. So I implement this in OnLvnItemchangedList event:
void CMyDlg::OnLvnItemchangedList(NMHDR *pNMHDR, LRESULT *pResult)
{
...
// canculate the rec by seleted row
CRect rec;
...// move button
m_myBtn.MoveWindow(rec);
m_myBtn.ShowWindow(SW_SHOW);
m_myBtn.BringWindowToTop();InvalidateRect(rec);
m_myBtn.RedrawWindow();}
It works, but I cannot see the button. :confused::confused: If the mouse moves over the button, it shows then I can see it. I don't know why, maybe there's something wrong in my last two source code rows. Can anyone explain how to solve this?? Thank you in advance !!
-
Check the coordinates of the button and you will see why you dont see it :-O
Greetings from Germany