Silverlight-4.0 – How to click on the left button instead of right click on Silverlight to open the context menu

How to open the context menu when left-clicking instead of right-clicking in silverlight

try Try this:

// On click
private void button1_Click(object sender, RoutedEventArgs e)
{
ContextMenuService.GetContextMenu (button1).IsOpen = true;
}

// O n right-click
private void button1_MouseRightButtonDown(object sender, MouseButtonEventArgs e)
{
e.Handled = true;
}

How to open the context menu when left-clicking instead of right-clicking in silverlight

Try this:

 // On click
private void button1_Click(object sender, RoutedEventArgs e)
{
Con textMenuService.GetContextMenu(button1).IsOpen = true;
}

// On right-click
private void button1_MouseRightButtonDown(object sender, MouseButtonEventArgs e)
{< br /> e.Handled = true;
}

Leave a Comment

Your email address will not be published.