
I just upgraded my appliations from UIStudio 1.0 to 2.0, and I'm having a problem getting around a behavior change, so this is a question on how to do it. First what I'm experiencing. I think the order of DocumentWindow creation has changed in an unexpected way between the two different versions of UIStudio. In UIStudio 1.0, when you created a new DocumentWindow, the events for contained controls occurred in roughly this order:
Constructor
OnSize
OnLoad
Show
This is the most common way that .Net control containers behave. In UIStudio 2.0 I'm seeing the following behavior (I could be off a bit, but this seems to be the behavior):
Constructor
OnLoad
Show
OnSize
So here's my problem. Most of the controls that are contained in DocumentWindows have their own layout state information that they save (this problem specifically affects splitters and splitter panels). In UIStudio 1.0 I would load that state in the OnLoad event, and things were just fine. When I upgraded, I started getting errors saying that the splitter location must be within the right bounds, etc. So I stepped into the code and noticed that in the OnLoad event, my view's size was still set to 0,0. So after some experimentation I noticed that the OnSize event fired after OnLoad, so I said, "ok, I can hook the first onsize event and load my state in there". That worked ok, except for one thing (the thing I'm trying to get around). If I load my splitter state in the OnSize event, when the view is brought up, it first loads with the default layout (one from the designer), then it flashes to the loaded state. So that tells me that the OnSize event occurs after the control is displayed. It first displays with the designer state, then loads the saved state. So the question is: Is there an event in UIStudio 2.0 that I can hook that fires before the control is shown, but after the sizes of the controls are set?
Thanks
Constructor
OnSize
OnLoad
Show
This is the most common way that .Net control containers behave. In UIStudio 2.0 I'm seeing the following behavior (I could be off a bit, but this seems to be the behavior):
Constructor
OnLoad
Show
OnSize
So here's my problem. Most of the controls that are contained in DocumentWindows have their own layout state information that they save (this problem specifically affects splitters and splitter panels). In UIStudio 1.0 I would load that state in the OnLoad event, and things were just fine. When I upgraded, I started getting errors saying that the splitter location must be within the right bounds, etc. So I stepped into the code and noticed that in the OnLoad event, my view's size was still set to 0,0. So after some experimentation I noticed that the OnSize event fired after OnLoad, so I said, "ok, I can hook the first onsize event and load my state in there". That worked ok, except for one thing (the thing I'm trying to get around). If I load my splitter state in the OnSize event, when the view is brought up, it first loads with the default layout (one from the designer), then it flashes to the loaded state. So that tells me that the OnSize event occurs after the control is displayed. It first displays with the designer state, then loads the saved state. So the question is: Is there an event in UIStudio 2.0 that I can hook that fires before the control is shown, but after the sizes of the controls are set?
Thanks