private void MOG_EventViewerMainForm_Load(object sender, EventArgs e)
        {
            // Set the size
            Width  = MogUtils_Settings.LoadIntSetting("GuiLayout", "Gui", "Width", 800);
            Height = MogUtils_Settings.LoadIntSetting("GuiLayout", "Gui", "Height", 600);
            // Set the location on screen
            if (MogUtils_Settings.Settings.PropertyExist("GuiLayout", "Gui", "left"))
            {
                Left = MogUtils_Settings.LoadIntSetting("GuiLayout", "Gui", "left");
            }
            if (MogUtils_Settings.Settings.PropertyExist("GuiLayout", "Gui", "top"))
            {
                Top = MogUtils_Settings.LoadIntSetting("GuiLayout", "Gui", "top");
            }

            // Check for client being visible
            Rectangle workArea = Screen.GetWorkingArea(this);

            if (Top < 0)
            {
                Top = 0;
            }
            if (Left < 0)
            {
                Left = 0;
            }
            if (Top > workArea.Bottom)
            {
                Top = workArea.Bottom - Height;
            }
            if (Left > workArea.Right)
            {
                Left = workArea.Left - Width;
            }
        }
Example #2
0
 private void ListForm_Load(object sender, EventArgs e)
 {
     MogUtils_Settings.LoadListView("ReportWindow", ListListView);
     Top    = MogUtils_Settings.LoadIntSetting("ReportWindow", "Top", Top);
     Left   = MogUtils_Settings.LoadIntSetting("ReportWindow", "Left", Left);
     Width  = MogUtils_Settings.LoadIntSetting("ReportWindow", "Width", Width);
     Height = MogUtils_Settings.LoadIntSetting("ReportWindow", "Height", Height);
 }