日期:2014-05-17 浏览次数:20719 次
private Control _Control; public Form1() { InitializeComponent(); } private void toolStripTextBox1_KeyUp(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { if (_Control != null) { _Control.Text = toolStripTextBox1.Text; } } } private void contextMenuStrip1_Opening(object sender, CancelEventArgs e) { _Control = contextMenuStrip1.SourceControl; }
------解决方案--------------------
楼上的方法很不错 LZ可以多研究 顺便可以了解下他们写出这些代码的思路