Click here to Skip to main content
15,899,754 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Here I am working on MFC dialogue based application,in which there are multiple child dialogues added in tab control;In one child dialogue there are multiple picture controls and I changed bitmap image dynamically on button clicked event,whenever I clicked one of the picture controls and switched to another tab(for Testing purpose)and coming back to current picture control tab that time all controls(which I've clicked previous time)are invisible!!!
How that change occurred and how to solve that problem???
Posted
Comments
Sergey Alexandrovich Kryukov 2-May-13 1:04am    
It means you screwed up something; it should not happen. But how anyone can know what exactly, if you did not provide any code sample?
—SA

1 solution

This depends of type of the picture control: owned draw, frame, bitmap etc...
Try redraw dialog by InvalidateRect() on "OnTab" event.
Or set WM_PAINT of the dialog and GetDC( GetDlgItem( hDlg, ID_PICTURE_CONTROL) ) etc..
Or use sub classing tecnology and write code of WM_PAINT event.
 
Share this answer
 
Comments
Venkat Raghvan 3-May-13 10:03am    
can you please give me some code snippets for reference!because I've tried on Tab control function,but doesn't happened
Style-7 4-May-13 1:32am    
case WM_PAINT:{
PAINTSTRUCT ps;
HDC hdc;
BeginPaint( hDlg, &ps);
HWND wnd =GetDlgItem( hDlg, IDC_MINI_BOARD);
hdc = GetDC( wnd);
................................................
ReleaseDC( wnd, hdc);
EndPaint( hDlg, &ps);
break;
}

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900