StrataFrame Forum

Stratalistview and ApplicationThreadManager

http://forum.strataframe.net/Topic31682.aspx

By Marcel Heitlager - 1/1/2013

This issue only seems to come up on Windows server 2003, not on windows 7.

I have an ApplicationThreadManager on the main mdi form.  On a child form I have a stratalistview in a themedSplitContainer.Panel.  When I fill the the listview using  a separate thread, the scrollbars dissapear.

If you put a msgbox at the end of the fill method of that listview on that separate thread, the scrollbar is there.  When you click ok, and the thread has completed, the scrollbar disappears.  Anyone else observe this phenomenon?

I worked around this issue by only retrieving the data from a separate thread.  But still wondered why this might happen.

Thanks,

Marcel
By Trent L. Taylor - 1/2/2013

Well, the message pump may not have completed before the scroll bars are fully initialized.  I have seen stuff like this before on different machines when there is, as you are dealing with, a threading issue.  Generally, I will move the loading logic to a thread safe location after all initialization logic has taken place on the core controls.

A semi-no-so-clean way to test this is to create a timer and drop it on the form and set it to something like 2-3 seconds.  Let this trigger your logic and see if the problem persists.  If not, then you know that the controls were not fully initialized and that a threaded conflict occurred.  In this case, you can just move the loading logic further downstream until you resolve it.  For example, override the OnLoad event of the form, call the base logic, then call your logic.  If that doesn't work, move to the OnShown, etc.