private string str;private void textBox1_MouseUp(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Right)
{
str = textBox1.SelectedText;
}
}

解决方案 »

  1.   

    如果要点击右键contextMenu其中一个项目才处理得到反白的事件呢?
      

  2.   

    在窗体中添加一个ContextMenu控件,然后在上面添加一项(和建立主菜单一样)把TextBox的ContextMenu属性设为contextMenu1(你随便改)在contextMenu1新添加的哪一项上写处理就行了
      

  3.   

    双击你添加的那一项菜单,就会自动生成如下代码:private void menuItem1_Click(object sender, System.EventArgs e)
    {}在其中写上str = textBox1.SelectedText;就可以了