0
I have a problem in my code, I have some actions on mouse moves in C# and would like to disable them. Whenever I drag the mouse to the listbox of my form, it already does the action, I would like to leave this on the mouse click, but I’m having difficulties, follow the code in case someone can help I appreciate.
private void lstColunasLayout2_MouseMove(object sender, MouseEventArgs e) {
int index = lstColunasLayoutSecundario.IndexFromPoint(new Point(e.X, e.Y));
ListBox lb = sender as ListBox;
if (index >= 0 && lb_item != null) {
lb.SelectedIndex = index;
AtualizaRelacaoColunas(lb);
lb_item = null;
}
}
Just to clarify, you want that same code in the listbox click event?
– Renato Afonso
It doesn’t have to be exactly the same, I would just like to know how to transpose this code to the click.
– user92218
You can accept an answer if you have satisfied your problem :)
– vinibrsl