I'm trying to make a popup by right-clicking inside a GridView
.
I am using the event MouseDown
and the event MouseUp
to make popupControlContainer
appear and disappear.
But how would you make it appear where the mouse is?
In search, I found here in StackOverFlow these two questions, however they are for WPF and I'm working with Winforms:
Options menu with right-click on datagrid
Options menu with right-click selected row in datagrid
I also found this question, but for .NET component, I need it for DevExpress:
#> link
Event code MouseDown
and MouseUp
private void click_right(object sender, MouseEventArgs e) // click com o botao do mouse direto em cima do grid view
{
if (e.Button == MouseButtons.Right) // botao direito
{
popupControlContainer1.Show();
}
}
private void upclick_right(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Right) // botao direito
{
popupControlContainer1.Hide();
}
}