if (e.Button.Properties.Caption == "New Note")
AddNote addnote = new AddNote(this);
public AddNote(ViewDetails _form1)
private void btnnewnote_Click(object sender, EventArgs e)
if (dataGridpelates.SelectedRows.Count == 1)
customerforms.AddNote.id = dataGridpelates.CurrentRow.Cells[0].Value;
customerforms.AddNote addnote = new customerforms.AddNote();
MessageBox.Show("Παρακαλώ επιλέξτε μία επαφή πρώτα.", "Σφάλμα!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);