Home All Groups Group Topic Archive Search About
Author
9 Aug 2006 6:47 AM
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

Author
9 Aug 2006 3:29 PM
Miro
Im new to vb.. but have you tried instead of doing the Me.Hide() to just try
to set the Opacity of the form to 0 first?

see if that work around solves ur display issue - then close the form?

-I have not had that happen to me at all with my Dialog forms.  ( vb2003 )

Miro


Show quoteHide quote
"gene kelley" <o***@by.me> wrote in message
news:jluid2pm9s89nkv5hsfn9jp4i7ciajen40@4ax.com...
>
> 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
Author
9 Aug 2006 7:37 PM
gene kelley
On Wed, 9 Aug 2006 11:29:55 -0400, "Miro" <miron***@golden.net> wrote:

>Im new to vb.. but have you tried instead of doing the Me.Hide() to just try
>to set the Opacity of the form to 0 first?
>
>see if that work around solves ur display issue - then close the form?
>
>-I have not had that happen to me at all with my Dialog forms.  ( vb2003 )
>
>Miro
>
>
The Opacity value of the dialog has no effect with regards to the problem.  It's the actual call to
Hide versus Close that triggers the problem.

It now appears that the problem is being caused by a 3rd party control in use in this particular
app.  If I temporarily remove it, the problem goes away, so I'm now checking with the control vendor
on this issue.

Gene







Show quoteHide quote
>"gene kelley" <o***@by.me> wrote in message
>news:jluid2pm9s89nkv5hsfn9jp4i7ciajen40@4ax.com...
>>
>> 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
>