Note that there are some explanatory texts on larger screens.

plurals
  1. POSuspendLayout Keep giving me an expection
    text
    copied!<p>I am trying to make a windows mobile application and for some reason the SuspendLayout keeps crashing.</p> <p>How it is crashing is this. I go to my login page for my app. I then rotate the phone to landscape and login.</p> <p>I then press the "OK" button that should close this new form I went to. I then am back to the the login page and I rotate the phone back to portrait mode. I then get an expect from the form(the one I just closed up).</p> <pre><code>System.ObjectDisposedException was unhandled Message="" ObjectName="" StackTrace: at Microsoft.AGL.Common.MISC.HandleAr(PAL_ERROR ar) at System.Windows.Forms.Control.get_Bounds() at Microsoft.AGL.Common.MISC.HandleAr(PAL_ERROR ar) at System.Windows.Forms.Control.SuspendLayout() at MiniPlannerWM.Views.Shared.PlannerForms.Planner.SetLayOut() at MiniPlannerWM.Views.Shared.PlannerForms.Planner.orientationChange_Changed(Object sender, ChangeEventArgs args) at Microsoft.WindowsMobile.Status.SystemState.RegistryState_ChangeOccured(Object sender, ChangeEventArgs args) at Microsoft.WindowsMobile.Status.RegistryState.notificationWindow_Changed(Object sender, ChangeEventArgs args) at Microsoft.WindowsMobile.Status.NotificationWindow.WndProc(Message&amp; msg) at Microsoft.WindowsCE.Forms.MessageWindow._WndProc(Message&amp; msg) at Microsoft.AGL.Forms.EVL.EnterMainLoop(IntPtr hwnMain) at System.Windows.Forms.Application.Run(Form fm) at MiniPlannerWM.Program.Main() </code></pre> <p><strong>Edit</strong></p> <p>I call the it when the orientation changes or when landscape is true. Since a person might rotate on the login form so all my forms have to adjust to for the rotation.</p> <p>so I have something like this</p> <pre><code>//login form_load { //figure out if they rotated this will be figured out by the SystemState.Change event that calls SetLayout that determine if they are in landscape or portrait. // set landscape property to true if they are in landscape mode. } // form1 form_load { // generate default layout(formed for portrait) // if landscape property is set to true Call SetLayout // other wise just keep in default layout mode. } SetLayout() { SuspendLayout(); // code to determine if they are in portrait mode or landscape mode // once determined change sizes and stuff for new mode. // set static landscape property to true or false to use for future forms. ResumeLayout(); } </code></pre> <p>If user changes rotation again(or the first time on that form) the SystemState.Change is event will be called. This calls the SetLayout().</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload