gpt4 book ai didi

c# - 如何从单击的 ToolStripDropDownButton 项中获取字符串?

转载 作者:行者123 更新时间:2023-12-02 22:37:24 25 4
gpt4 key购买 nike

btn1 是 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.
}

关于c# - 如何从单击的 ToolStripDropDownButton 项中获取字符串?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11268873/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com