Note that there are some explanatory texts on larger screens.

plurals
  1. POWeird behavior saving application location and size
    text
    copied!<p>I'm using Windows Forms (C#). I save my window location and size to disk in the <code>Closing</code> event of my form, using the following properties:</p> <pre><code>(int) Width, Height -&gt; using the Form.Size property (int) LocationX, LocationY -&gt; using the Form.Location property (bool) Maximized -&gt; using the Form.WindowState property </code></pre> <p>The form is the Application main form. When the application loads, I set those properties to the form. It's simple.</p> <p>Well, the most of the times it works perfect, but sometimes, only sometimes, the application is shown very little. I have added debug information and these are the values the form returned:</p> <pre><code>2011-09-01 20:02:44,334 DEBUG 9884 MainFormSettings - Width -&gt; 160 2011-09-01 20:02:44,334 DEBUG 9884 MainFormSettings - Height -&gt; 27 2011-09-01 20:02:44,334 DEBUG 9884 MainFormSettings - LocationX -&gt; -32000 2011-09-01 20:02:44,334 DEBUG 9884 MainFormSettings - LocationY -&gt; -32000 2011-09-01 20:02:44,334 DEBUG 9884 MainFormSettings - Maximized -&gt; False </code></pre> <p>I'm sure that my window was not of that size (160, 27) and also the location was not -32000, because I use only one monitor.</p> <p>This seems that occur when I have the application opened for a long time, but not sure.</p> <ul> <li>Do you know why sometimes the for has these strange values?</li> <li>Could affect store this in the Closing event (I also tried to do it in the Closed event) with the same result?</li> </ul> <p>Thanks in advance</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