public void SaveWindowPosition(RegistryKey key)
{
CheckDisposed();
if ((m_normalWidth == 0 || m_normalHeight == 0) && Parent != null)
{
// make sure that we have a width and height set
m_normalLeft = (Parent is Form ?
((Form)Parent).DesktopBounds.Top : Parent.Left);
m_normalTop = (Parent is Form ?
((Form)Parent).DesktopBounds.Top : Parent.Top);
m_normalWidth = (Parent is Form ?
((Form)Parent).DesktopBounds.Width : Parent.Width);
m_normalHeight = (Parent is Form ?
((Form)Parent).DesktopBounds.Height : Parent.Height);
}
key.SetValue(Parent.GetType().Name + "Top", m_normalTop);
key.SetValue(Parent.GetType().Name + "Left", m_normalLeft);
key.SetValue(Parent.GetType().Name + "Width", m_normalWidth);
key.SetValue(Parent.GetType().Name + "Height", m_normalHeight);
}