private void Lbsorden_MouseMove(object sender, MouseEventArgs e) { int index = Lbsorden.IndexFromPoint(Lbsorden.PointToClient(Cursor.Position)); if (index != prevIndex) { prevIndex = index; Lbsorden.Invalidate(); } }
private void MainFormReportes_Load(object sender, EventArgs e) { idprograma = 1; this.gendbfformatoreporteTableAdapter.Fill(this.dSGEN.gendbfformatoreporte, idprograma); this.ordenTableAdapter1.Fill(ds, idprograma); ordenar(); matriz1 = new string[Lbsorden.Items.Count]; for (int i = 0; i < Lbsorden.Items.Count; i++) { matriz1[i] = Lbsorden.Items[i].ToString(); } Lbsorden.Focus(); }
private void Lbsorden_DragDrop(object sender, DragEventArgs e) { int a = this.Lbsorden.Items.Count - 1; Point point = Lbsorden.PointToClient(new Point(e.X, e.Y)); int index = this.Lbsorden.IndexFromPoint(point); if (index < 0) { index = a - 1; } Item obj = new Item(((Item)Lbsorden.SelectedItem).Name, ((Item)Lbsorden.SelectedItem).Value); this.Lbsorden.Items.Remove(Lbsorden.SelectedItem); this.Lbsorden.Items.Insert(index, obj); mientrastanto(); }
private void Lbsorden_MouseLeave(object sender, EventArgs e) { prevIndex = -1; Lbsorden.Invalidate(); }
private void Lsbformato_SelectedIndexChanged(object sender, EventArgs e) { ordenar(); Lbsorden.Focus(); }