我有一个带有contextmenustrip的下拉按钮。工具条中的项目是可检查的。我想要检查项目'要复制到富文本框中的文本。到目前为止,我已经设法编写了这段代码,但是当我运行该程序时,它不会工作。可以帮助吗? 非常感谢!
List<string> bejelolve;
string bejeloltek;
private void betterSplitButton1_MouseClick(object sender, MouseEventArgs e)
{
betterSplitButton1.ContextMenuStrip.Close();
if (e.Button == System.Windows.Forms.MouseButtons.Left)
{
betterSplitButton1.BackColor = System.Drawing.Color.Yellow;
foreach (ToolStripMenuItem item in contextMenuStrip1.Items)
{
if (item.CheckState == CheckState.Checked)
{
bejelolve = new List<string>();
bejelolve.Add(item.Text);
bejeloltek = string.Join(",", bejelolve.ToArray());
}
}
richTextBox1.AppendText("Verify information \n" + toolStripTextBox1.Text + bejeloltek);
}
我收到错误无法转换类型为#System; Winds.Forms.ToolStripTextBox&#39;的对象输入&#39; System.Windows.Forms.ToolStripMenuItem&#39;。