How to work with windows (forms) in C #? Open a new window, but so that the old was still open, or so that the old was closed. Set the width of the window, height and anything else =)

Thanks in advance!

    2 answers 2

    Something like this

    // Какой-то обработчик private void buttonOldForm_Click(object sender, System.EventArgs e) { // Прячем текущую форму (если надо) this.Hide(); // Создаем и показываем новую форму NewForm f = new NewForm(); f.InstanceRef = this; f.Show(); } 

    And to move, use the Location property (and the like):

     f.Location = new Point(0, 0); 

      Weird question. I even don’t recall the examples of programs where the main form of the program closes when a new one opens. If you show the user, for example, application options, then the main window should definitely remain. If you want to display some new functionality of the application, then it is better to do it in the same window using something like tabs.