不知道這是你在找什麼,但我相信,你會發現優於本
你可以試試這個當鼠標按下稱爲
private void richTextBox1_MouseDown(object sender, MouseEventArgs e)
{
// Continue if the Right mouse button was clicked
if (e.Button == MouseButtons.Right)
{
// Check if the selected item starts with http://
if (richTextBox1.SelectedText.IndexOf("http://") > -1)
{
// Avoid popping the menu if the value contains spaces
if (richTextBox1.SelectedText.Contains(' '))
{
// Show the menu
contextMenuStrip1.Show(Cursor.Position.X, Cursor.Position.Y);
}
}
}
}
還是這個當鏈接被點擊,但這並不適用於鼠標右鍵點擊
private void richTextBox1_LinkClicked(object sender, LinkClickedEventArgs e)
{
contextMenuStrip1.Show(Cursor.Position.X, Cursor.Position.Y);
}
謝謝,
我希望這有助於:)