Home > Software engineering >  Make a button create a new item when clicked
Make a button create a new item when clicked

Time:02-22

Hey I am trying to create a notes app in windows form and I cant figure out how to create a new item with a button (usually done by right clicking on the app name > add new > windows form)

for example;

if button1 is clicked create a new form called note1

thanks

CodePudding user response:

create a second Form in the designer, call it Note.

add all the controls you want.

Now in the Main form when you want to show the Note form do (in a click handler say)

  var note1 = new Note();
  note.Show();
  • Related