如何从工具栏下拉按钮项获取字符串单击



>btn1 is ToolStripDropDownButton

我怎么能这样说呢

private void btn1_DropDownItemClicked(object sender, ToolStripItemClickedEventArgs e)
{
 MessageBox.Show(btn1.CurrentItem.Text.ToString()); // CurrentItem = item clicked.
}
private void btn1_DropDownItemClicked(object sender, ToolStripItemClickedEventArgs e)
{
  MessageBox.Show(e.ClickedItem.Text); // ClickedItem = item clicked.
}

相关内容

  • 没有找到相关文章

最新更新