コード例 #1
0
ファイル: MainForm.cs プロジェクト: schalkje/PhotoDesktop
        protected override void OnShown(EventArgs e)
        {
            ScaledScreen windowScreen = ScaledScreen.AllScaledScreens[0];

            // if mode = top-right
            // Left = windowScreen.UnscaledBounds.Width - Width; //Size.Width;
            // Top = 0;

            // if mode = bottom-right
            //Left = windowScreen.UnscaledWorkingArea.Width - Width; //Size.Width;
            //Top = windowScreen.UnscaledWorkingArea.Height - Height;

            // position this window to legenda position
            Rectangle legendaRect = Wallpaper.GetLegendaRect(_photoDesktop.GetMainScreenName());

            this.Left = legendaRect.Left + offset.X;
            this.Top  = legendaRect.Top - this.Height + offset.Y;


            base.OnShown(e);

            //Width = 400;
            //Height = 100;
            //Left = windowScreen.UnscaledWorkingArea.Width - Width; //Size.Width;
            //Top = windowScreen.UnscaledWorkingArea.Height - Height;

            // if debug mode; show settings
#if DEBUG
            SettingsForm settingsForm = new SettingsForm(_photoDesktop);
            if (settingsForm.ShowDialog() == DialogResult.OK)
            {
                LoadSettings(settingsForm.RefreshImageList);
            }
#endif
        }