Answer the question
In order to leave comments, you need to log in
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
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question