You can do so via the Click event handler on the ToolStripMenuItem
.
Part 1 - programmatically adding menu items
Just add a new ToolStripMenuItem
to the MenuStrip
like so:
ToolStripMenuItem mi = new ToolStripMenuItem("whatever");
mi.Click += new EventHandler(menuItemHandler_Click);
menuStrip1.Items.Add(mi);
They can all reference the same event handler (see below).
Part 2 - event handler to start your process
The event handler will start the process, using the text of the menu item that was clicked:
private void menuItemHandler_Click(object sender, EventArgs e)
{
Process.Start("google.com/" + (sender as ToolStripMenuItem).Text);
}
Based on the code above, Process.Start()
will receive google.com/whatever
as the parameter.