In addition to Richard's MacCutchan answer...
Replace this:
if(MessageBox.Show("Hello", "Inject", MessageBoxButtons.OK, MessageBoxIcon.None)==DialogResult.Yes)
with:
if(MessageBox.Show("Hello", "Inject", MessageBoxButtons.OK, MessageBoxIcon.Information)==DialogResult.OK)
{
f1 = new Form1();
}
due to the fact that:
DialogResult.Yes
returns
6
DialogResult.OK
returns
1
,
So, your
if
condition will never get true.
DialogResult Enum (System.Windows.Forms) | Microsoft Docs[
^]