N
N
nivladimir2018-03-29 23:40:26
C++ / C#
nivladimir, 2018-03-29 23:40:26

How can I fix the image replacement error in c#?

I work with windowsforms when processing the event: 1) double click - the picture is replaced; 2) click - changes to the one that was before. The problem is that only the single click event is processed, and the double click is simply ignored. With what it can be connected? And how to fix it?
private void toolStripButton5_DoubleClick(object sender, EventArgs e)
{
ImageList imageList1 = new ImageList();
imageList1.Images.Add(Image.FromFile("unblock1.png"));
toolStripButton5.Image = imageList1.Images[0];
}
private void toolStripButton5_Click(object sender, EventArgs e)
{
ImageList imageList1 = new ImageList();
imageList1.Images.Add(Image.FromFile("block1.png"));
toolStripButton5.Image = imageList1.Images[0];
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrew, 2018-03-30
@byte916

Do you have a double click event attached to a button?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question