In each form of solution there is a menu, it is absolutely identical on each form. Is it necessary to copy the code of clicks on it into each form, or can it be done differently?

For example, in each form I have a menu and code:

private void оПрограммеToolStripMenuItem_Click(object sender, EventArgs e) { About frm = new About(); frm.Show(); } 

Is it possible to move it somewhere to one place and call it from there?

    2 answers 2

    You can create a parent form that will contain a general menu and general event handlers for selecting menu items. And then from this form the parent inherits all its forms.

      If the menu is the same on all forms, then use Frame. In it, create a menu. Register everything you need. And then paste it into each form.