Пример #1
0
 public AutoFormSaver(Form formuse, FormPlacement fsaver)
 {
     //must be called in the Form's Initialize() routine.
     mFormSave = formuse;
     mFormSave.Load += new EventHandler(mFormSave_Load);
     mFormSave.Closing += new System.ComponentModel.CancelEventHandler(mFormSave_Closing);
 }
Пример #2
0
 public override void SaveFormPlacement(Form forForm, FormPlacement.WINDOWPLACEMENT placementdata)
 {
     BinaryFormatter useformatter = new BinaryFormatter();
     storagestream.Seek(0, SeekOrigin.Begin);
     storagestream.SetLength(0);
     useformatter.Serialize(storagestream, placementdata);
 }
Пример #3
0
        public override void SaveFormPlacement(Form forForm, FormPlacement.WINDOWPLACEMENT placementdata)
        {
            INISection usesection = GetPlacementSection(forForm);

            usesection["MinPosX"].Value = placementdata.ptMinPosition.x.ToString();
            usesection["MinPosY"].Value = placementdata.ptMinPosition.y.ToString();

            usesection["MaxPosX"].Value = placementdata.ptMaxPosition.x.ToString();
            usesection["MaxPosY"].Value = placementdata.ptMaxPosition.y.ToString();

            usesection["Flags"].Value = placementdata.flags.ToString();

            usesection["Left"].Value = placementdata.rcNormalPosition.Left.ToString();
            usesection["Top"].Value = placementdata.rcNormalPosition.Top.ToString();
            usesection["Right"].Value = placementdata.rcNormalPosition.Right.ToString();
            usesection["Bottom"].Value = placementdata.rcNormalPosition.Bottom.ToString();
        }