winforms - .NET Compact Framework: how to ensure form is visible before running code? -


we've got model-view-presenter setup our .net compact framework app. standard cf form implementing view interface, , passed constructor of presenter. presenter tells form show calling view.run(); view show() on itself, , presenter takes on again, loading data , populating view.

problem view not finishing showing before control returned presenter. since presenter code blocks few seconds while loading data, effect form not visible few seconds. it's not until after presenter finishes it's data load form becomes visible, though form called show() on before presenter started data loading.

in standard windows environment, use .shown event on form... compact framework doesn't have this, , can't find equivalent.

does know of even, pinvoke, or other way form visible before kicking off code on presenter? @ point, i'd ok form calling presenter , telling presenter start it's data load.

fyi - we're trying avoid multi-threading, cut down on complexity , resource usage.

if key problem form won't paint before presenter data loading methods completed, , have call this.show() in form_load, try putting application.doevents() directly after this.show() force/allow form paint.

protected void form_load(blah blah blah) {    this.show();    application.doevents();     ... data loading methods ... } 

Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -