How to compare the background image of a button reference?

时间:2019-03-19 14:57:17

标签: c# winforms

I am trying to compare the background image of previousButton(a button reference) to the background image of Bpown(a button) but the if will not work.

I have tried changing a button's background image to previousButton's BackgroundImage and it worked so it is not connected to the problem.

void click()
        {
            if (turn == true)
            {
                if (previousButton.BackgroundImage == Bpown.BackgroundImage)
                {
                    //unreachable code
                }
            }
        }

EDIT: This is a windows form project

0 个答案:

没有答案