G
gene kelley
I have a dialog form, frmDetails, that is opened from the main form:
frmDetails.ShowDialog()
The only way I have provided to close this dialog is via the "X" button.
If frmDetails is just closed as normal, there is no visual problem (no repainting) with the main
form.
Now, I add this code to the the FormClosing event in the dialog, frmDetails:
If e.CloseReason = CloseReason.UserClosing Then
e.Cancel = True
Me.Hide()
End If
In this case, the dialog hides, but in the process there is unacceptable amount of repainting on the
main form. A portion of the top right client area on the main form turns transparent for an instant
showing portions of any underlying app that may be present. I gather that this transparency
business is probably causing the repainting.
Does anyone know if the Hide method has a bug? Better method? Workaround?
Gene
frmDetails.ShowDialog()
The only way I have provided to close this dialog is via the "X" button.
If frmDetails is just closed as normal, there is no visual problem (no repainting) with the main
form.
Now, I add this code to the the FormClosing event in the dialog, frmDetails:
If e.CloseReason = CloseReason.UserClosing Then
e.Cancel = True
Me.Hide()
End If
In this case, the dialog hides, but in the process there is unacceptable amount of repainting on the
main form. A portion of the top right client area on the main form turns transparent for an instant
showing portions of any underlying app that may be present. I gather that this transparency
business is probably causing the repainting.
Does anyone know if the Hide method has a bug? Better method? Workaround?
Gene