Beispiel #1
0
        public FormMain()
        {
            InitializeComponent();
            CheckForIllegalCrossThreadCalls = false;

            Form splash = new FormSplash();

            splash.Show();
            splash.Refresh();

            // Set up DeckCounter class
            dc = new DeckCounter(deck);
            // Set accessor values
            dc.LabelNumCards = labelNumCards;
            dc.LabelTopdeck  = labelTopdeck;
            dc.FormMain      = this;
            // Load last deck
            if (dc.Options.GetAsString("LastDeck") != "")
            {
                dc.LoadDeck(dc.Options.GetAsString("LastDeck"));
            }

            int w = Screen.PrimaryScreen.WorkingArea.Width;
            int h = Screen.PrimaryScreen.WorkingArea.Height;

            this.MaximumSize = new System.Drawing.Size(w, h);

            splash.Hide();
            splash.Dispose();

            if (dc.Options.GetAsInteger("WindowMainX") != 0)
            {
                this.StartPosition = FormStartPosition.Manual;
                this.Location      = new Point(dc.Options.GetAsInteger("WindowMainX"), dc.Options.GetAsInteger("WindowMainY"));
            }

            dc.SetStayOnTop(dc.Options.GetAsBool("StayOnTop"));
        }
Beispiel #2
0
 private void checkBoxOnTop_CheckedChanged(object sender, EventArgs e)
 {
     dc.SetStayOnTop(checkBoxOnTop.Checked);
     this.TopMost = checkBoxOnTop.Checked;
 }