private void anotherWindowButton_Click(object sender, EventArgs e) { TowerOfHanoiForm anotherForm = new TowerOfHanoiForm(m_workerThread); Controller anotherController = new Controller(); FormController anotherFormController = new FormController(anotherForm, anotherController); anotherForm.Show(); }
public TowerOfHanoiForm(WorkerThreadClass workerThread) { InitializeComponent(); m_controller = new Controller(); m_formController = new FormController(this, m_controller); this.m_workerThread = workerThread; drawArea.BackColor = Color.LightGray; polesNumber.Text = m_defaultTextBoxValue; discNumber.Text = m_defaultTextBoxValue; this.MinimumSize = new Size(838, 517); invalidPoleNumber.Text = " "; invalidDiscNumber.Text = " "; }
private void ResetValues() { //use using Graphics graphics = drawArea.CreateGraphics(); m_numberOfDiscs = 0; m_numberOfPoles = 0; m_controller = new Controller(); m_formController = new FormController(this, m_controller); graphics.Clear(Color.LightGray); startButton.Visible = false; graphics.Dispose(); }