实现效果:
知识运用:
MouseEventArgs类的Button属性 TextBox控件的ContextMenu属性
实现代码:
private void textBox1_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Right)
textBox1.ContextMenu = new ContextMenu();
}
2023-07-29 16:27:46
实现效果:
知识运用:
MouseEventArgs类的Button属性 TextBox控件的ContextMenu属性
实现代码:
private void textBox1_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Right)
textBox1.ContextMenu = new ContextMenu();
}