Different behavior of ShowDialog between CF1 & CF2

  • Thread starter Thread starter Alex Stark
  • Start date Start date
A

Alex Stark

Hi,

I have a WM2003 application ported from Compact Framework 1 to 2.
In my main menu I do a simple :

ToolsForm tf = new ToolsForm();
tf.ShowDialog();

in ToolsForm.Load I do some init stuff and show a state message. This
works with CF 1. But after porting this app to CF2 I have a different
behavior. The ToolsForm form is shown just after the Load-Methode is
executed, so that I can not see any state messages. It seems that in CF1
after a ShowDialog first the Form is shown and then the Load-Method is
execuded. In CF2 it seems that first the Load-Method is executed and
after that, the Form is shown. I haven't found a solution for this proble,
Refresh() on top of Load method doesn't matter.
Does anyone have a solution for this problem ?

Best regards
Alex
 
Alex said:
Hi,

I have a WM2003 application ported from Compact Framework 1 to 2.
In my main menu I do a simple :

ToolsForm tf = new ToolsForm();
tf.ShowDialog();

in ToolsForm.Load I do some init stuff and show a state message. This
works with CF 1. But after porting this app to CF2 I have a different
behavior. The ToolsForm form is shown just after the Load-Methode is
executed, so that I can not see any state messages. It seems that in CF1
after a ShowDialog first the Form is shown and then the Load-Method is
execuded. In CF2 it seems that first the Load-Method is executed and
after that, the Form is shown. I haven't found a solution for this proble,
Refresh() on top of Load method doesn't matter.
Does anyone have a solution for this problem ?

Best regards
Alex

Perhaps you could try moving the code that is in ToolsForm_Load into the
constructor of the form (Sub New)
 
I found a little workaround. If I call base.Show() on the top of the
Form.Load() method, everything works like in CF 1.
 
Back
Top