Form1 is the program itself, and Form2 is the same as Form1 only the form itself is smaller and does not have all the buttons with Form1 . This is something like a music player, Form1 is the player itself, and Form2 is a mini player. Can you make the Form1 functions work on Form2 ? That is, not to create the same functions on Form2 .

  • inherit both forms from the same base class - Igor
  • implement the player in a separate class (not a form), pass a link to it in both forms and pull methods. The standard separation of logic and form, you can then easily port to WPF, another graphical platform or even to the console - rdorn
  • Can you answer in more detail where to click and what to do? I do not know how to do it. - Gif

1 answer 1

 private void button1_Click(object sender, System.EventArgs e) { Form2 frm = new Form2(); frm.Show(); } // Create Form2. public class Form2: Form { public Form2() { Text = "Form2"; } } 

An example is taken from here.

  • This is the answer to what question? - Andrey NOP
  • for this: Can you make the Form1 functions work on Form2? That is, not to create the same functions on Form2. - Evgeny Gusev