Form Afterimage

G

gregarican

I am using VS2005 for creating a pretty basic application. When I open
another form from my main form using a button event I just do
something like:

NewForm newForm = new NewForm();
newForm.Show();

Then when I'm done with the new form I use another button event like:

this.Close();

The problem is that the new form that was opened still has a lingering
afterimage on the screen after its closed. If I move the main form
around the screen some then the afterimage disappears. Is there
something that I'm not doing correctly? In the interim I just open the
new form through:

NewForm newForm = new NewForm();
newForm.ShowDialog();

This gets rid of the afterimage. I don't want my app this modal
though. Any suggestions?
 
G

gregarican

I am using VS2005 for creating a pretty basic application. When I open
another form from my main form using a button event I just do
something like:

NewForm newForm = new NewForm();
newForm.Show();

Then when I'm done with the new form I use another button event like:

this.Close();

The problem is that the new form that was opened still has a lingering
afterimage on the screen after its closed. If I move the main form
around the screen some then the afterimage disappears. Is there
something that I'm not doing correctly? In the interim I just open the
new form through:

NewForm newForm = new NewForm();
newForm.ShowDialog();

This gets rid of the afterimage. I don't want my app this modal
though. Any suggestions?

A little bit more background info. The main form isn't set up as a
MDIContainer, and I am launching the other forms through
ToolStripButtons. Is the only way around this either making all of the
new forms MDIChildren or else initializing them through ShowDialog()?
 
G

gregarican

A little bit more background info. The main form isn't set up as a
MDIContainer, and I am launching the other forms through
ToolStripButtons. Is the only way around this either making all of the
new forms MDIChildren or else initializing them through ShowDialog()?- Hide quoted text -

- Show quoted text -

I noticed that if I clicked on the 'X' button in the top right-hand
corner of the form to invoke the typical Windows close action the
strange ghost image didn't appear. But my own close button control at
the bottom of the form consistently left this ghost image. The form
consists of a Label control, a DataGridView control, and has
underlying SQL Server data source connections. I tried the preface
this.Close() with this.Dispose() to help catch any unreleased
resources. Still no luck. My only workaround wound up being prefacing
this.Close() with this.Hide() to force the form to disappear. Strange.
My VS 2005 is running at SP2, so I would assume it's patched for major
bugs. Am I missing something blatently obvious :-/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top