введите здесь описание изображения
Код: Выделить всё
using System.Windows.Forms;
namespace WindowsFormsApp2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
lbItems.Items.Add("1");
lbItems.Items.Add("2");
lbItems.Items.Add("3");
lbItems.Items.Add("4");
lbItems.Items.Add("5");
lbItems.Items.Add("6");
lbItems.MouseDown += LbItems_MouseDown;
lbItems.SelectedValueChanging // not found
}
private void LbItems_MouseDown(object sender, MouseEventArgs e)
{
// I want to cancel click to the item in ListBox
}
}
}
Подробнее здесь: https://stackoverflow.com/questions/793 ... ct-by-item
Мобильная версия