I am trying to save the position of a custom dialog to the users registry, so that when they reload the same dialog, it appears in the same place they moved or resized it to pre
I guess you are updating the window position when the window is closed? There are a couple of solutions if that is the case.
1) Save the window position on a different event, like when the window is resized or moved. 2) Check to see if the window is minimized before saving the X and Y positions.
Example:
switch (this.WindowState)
{
case WindowState.Maximized:
// don't update the X,Y
break;
case WindowState.Minimized:
// don't update the X,Y
break;
case WindowState.Normal:
// DO update the X,Y
break;
}