public void Initialize(DisplayWindowContent window) { dispContent = window; Controls.Clear(); Controls.Add(window); DoResize(); DoLayout(); }
public DisplayWindow(DisplayWindowContent cont) { //this.peanut_butter = peanut_butter; //this.individual_levels = individual_levels; Text = "Star Fox 64 Score Tracker"; FormClosing += new FormClosingEventHandler(InputWindow.mainWindow.ConfirmClose); // Set colors BackColor = ScoreTracker.colors["background_color"]; Initialize(cont); // Redraw the form if the window is resized Resize += delegate { DoLayout(); }; //Move += delegate { DoLayout(); }; // Draw the form DoLayout(); int x = -10000; int y = -10000; try { x = Int32.Parse(ScoreTracker.config["tracker_x"]); y = Int32.Parse(ScoreTracker.config["tracker_y"]); } catch (Exception) { } if (x != -10000 || y != -10000) { this.StartPosition = FormStartPosition.Manual; this.Location = new Point(x, y); } Show(); // When the form is shown set the focus to the input box // Close the network connection when the form is closed // To prevent any hangups //FormClosing += delegate { CloseNetwork(); }; }