I have a dialog in which I draw and fill a rectangle with a colour in the OnPaint method of the dialog. When I run my application the dialog is displayed and I see the rectangle being drawn and filled, but then it disappears. If I drag another window on top of it I can see the rectangle filled, but not the other controls of the dialog. Finally if after dragging another window over top of the dialog and back off if I move the dialog the other controls come back but the rectangle disappears again.