PC Review


Reply
Thread Tools Rate Thread

Code in MDI child form Activated event handler causes form to appear as partially visible when loading

 
 
RJ
Guest
Posts: n/a
 
      1st Nov 2006
I want to have the entire form remain invisible until after all the code in
the Activated event handler has executed. The current behaviour - the form
appears to "freeze" before completely being painted, then hesitates a few
seconds before completely painting.
In my testing, I simulate the form paint problem in a normal SDI form. I
tried setting the .SetVisibleCore property, but this resulted in an
"activation loop". That is, the activated event handler calls
SetVisibleCore, SetVisibleCore raises the activated event. Any ideas?

Thanks,
RJ


 
Reply With Quote
 
 
 
 
Bryan Phillips
Guest
Posts: n/a
 
      1st Nov 2006
What operations are you running in the Activated event handler? Can you
run them on another thread?

Bryan Phillips
MCSD, MCDBA, MCSE
Blog: http://bphillips76.spaces.live.com




"RJ" <(E-Mail Removed)> wrote in message
news:#nvZd#f$(E-Mail Removed):

> I want to have the entire form remain invisible until after all the code in
> the Activated event handler has executed. The current behaviour - the form
> appears to "freeze" before completely being painted, then hesitates a few
> seconds before completely painting.
> In my testing, I simulate the form paint problem in a normal SDI form. I
> tried setting the .SetVisibleCore property, but this resulted in an
> "activation loop". That is, the activated event handler calls
> SetVisibleCore, SetVisibleCore raises the activated event. Any ideas?
>
> Thanks,
> RJ


 
Reply With Quote
 
RJ
Guest
Posts: n/a
 
      2nd Nov 2006
Bryan, Unfortunately, the slow running code in the Activated handler, is
acquiring data to be displayed on the form, so I must wait for the data
acquisition code to complete. I thought about running the code on another
thread, but I still must defer visibility of the form.


"Bryan Phillips" <(E-Mail Removed)> wrote in
message news:u77QzUg$(E-Mail Removed)...
> What operations are you running in the Activated event handler? Can you
> run them on another thread?
>
> Bryan Phillips
> MCSD, MCDBA, MCSE
> Blog: http://bphillips76.spaces.live.com
>
>
>
>
> "RJ" <(E-Mail Removed)> wrote in message
> news:#nvZd#f$(E-Mail Removed):
>
>> I want to have the entire form remain invisible until after all the code
>> in
>> the Activated event handler has executed. The current behaviour - the
>> form
>> appears to "freeze" before completely being painted, then hesitates a few
>> seconds before completely painting.
>> In my testing, I simulate the form paint problem in a normal SDI form. I
>> tried setting the .SetVisibleCore property, but this resulted in an
>> "activation loop". That is, the activated event handler calls
>> SetVisibleCore, SetVisibleCore raises the activated event. Any ideas?
>>
>> Thanks,
>> RJ

>



 
Reply With Quote
 
Bryan Phillips
Guest
Posts: n/a
 
      2nd Nov 2006
If it is possible, try to get your data before calling the Show method
on the form. Also, if this is the first form in the application, you
could display a splash screen while the data loads.

Bryan Phillips
MCSD, MCDBA, MCSE
Blog: http://bphillips76.spaces.live.com



"RJ" <(E-Mail Removed)> wrote in message
news:#Jq1aUo$(E-Mail Removed):

> Bryan, Unfortunately, the slow running code in the Activated handler, is
> acquiring data to be displayed on the form, so I must wait for the data
> acquisition code to complete. I thought about running the code on another
> thread, but I still must defer visibility of the form.
>
>
> "Bryan Phillips" <(E-Mail Removed)> wrote in
> message news:u77QzUg$(E-Mail Removed)...
>
> > What operations are you running in the Activated event handler? Can you
> > run them on another thread?
> >
> > Bryan Phillips
> > MCSD, MCDBA, MCSE
> > Blog: http://bphillips76.spaces.live.com
> >
> >
> >
> >
> > "RJ" <(E-Mail Removed)> wrote in message
> > news:#nvZd#f$(E-Mail Removed):
> >

>
> >> I want to have the entire form remain invisible until after all the code
> >> in
> >> the Activated event handler has executed. The current behaviour - the
> >> form
> >> appears to "freeze" before completely being painted, then hesitates a few
> >> seconds before completely painting.
> >> In my testing, I simulate the form paint problem in a normal SDI form. I
> >> tried setting the .SetVisibleCore property, but this resulted in an
> >> "activation loop". That is, the activated event handler calls
> >> SetVisibleCore, SetVisibleCore raises the activated event. Any ideas?
> >>
> >> Thanks,
> >> RJ

>
> >


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Call an event handler on a parent form from child form jimcolli@pacbell.net Microsoft C# .NET 3 20th Jan 2006 02:32 AM
How to know in the MdiChildActivate event handler if the child is closed (or activated). **Developer** Microsoft VB .NET 0 21st Nov 2005 02:42 AM
Re: cancel loading process in form load event handler Jay B. Harlow [MVP - Outlook] Microsoft VB .NET 0 10th Jul 2003 03:03 PM
cancel loading process in form load event handler Giri Microsoft VB .NET 0 10th Jul 2003 08:31 AM
Re: cancel loading process in form load event handler Stephen Muecke Microsoft VB .NET 0 10th Jul 2003 07:25 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:14 AM.