您应该能够使用Tag属性来保存图片描述信息。
至于确定PictureBox您可以使用MouseEnter事件的上下文。基本上定义一个类级PictureBox变量(PictureBoxOnContext)。
然后,您可以将MouseEnter事件处理程序添加到PictureBox实例并将其强制sender转换为 aPictureBox并将其分配给PictureBoxOnContext变量。
当您右键单击 时PictureBox,MouseEnter已经触发并且相关项PictureBox被选择到PictureBoxOnContext变量中。
然后在“添加描述”上下文菜单上单击您可以检查是否PictureBoxOnContext != null并将其传递给预览表单。
(剩下的你应该能够弄清楚;可能利用代表将信息传回给父表单)
private PictureBox PictureBoxOnContext;
private void AddPicture_Click(object sender, EventArgs e)
{
PictureBox picBox = new PictureBox();
//Your code logic to add PictureBox to FlowLayout
picBox.MouseEnter += new EventHandler(PictueBox_MouseEnter);
}
void PictueBox_MouseEnter(object sender, EventArgs e)
{
PictureBoxOnContext = (PictureBox)sender;
}
private void AddDescriptionToolStripMenuItem_Click(object sender, EventArgs e)
{
if (PictureBoxOnContext != null)
{
//Pass this PictureBoxOnContext to your preview window/ your opearations
PictureBoxOnContext = null;
}
}