1
Good evening, I would like to associate a common event for all label_DragOver and label_DragDrop... such a thing would be possible?
    string _currLabel = string.Empty;
    private void Form1_Load(object sender, EventArgs e)
    {
        listBox1.Items.Add("lol1");
        listBox1.Items.Add("lol2");
        listBox1.Items.Add("lol3");
        listBox1.Items.Add("lol4");
        listBox1.Items.Add("lol5");
    }
    private void listBox1_MouseDown(object sender, MouseEventArgs e)
    {
        if(listBox1.SelectedItem!=null)
        { 
            DragDropEffects _effect = DoDragDrop(listBox1.SelectedItem, 
                                                  DragDropEffects.All);
        }         
    }
    private void ChangeLabelName(Label c)
    {
       c.Text = _selectedItem(); 
    }
    private string _selectedItem()
    {
        return listBox1.GetItemText(listBox1.SelectedItem);
    }
    private void label1_DragOver(object sender, DragEventArgs e)
    {
        e.Effect = DragDropEffects.All;
    }
    private void label1_DragDrop(object sender, DragEventArgs e)
    {
        Label s = (Label)sender;
        ChangeLabelName(s);         
    }
Explain better what you want to do and how events are activated?
– Maniero
I have about 15 Abels and did not want to repeat code... I want to associate a drag-over and drag-drop event to all Abels...
– Hxfs