Home > Net >  Small white consult winform problem
Small white consult winform problem

Time:12-05

Small white to ask a question: winform label background gray 1, the mouse into the background such as red; 2, the mouse left, background color reduction; 3, the mouse to click the background such as blue, and kept; 4, there are a lot of the same label to achieve the same function, and, in step 3, click on the background of the label change, other unchanged, when click the other label, click on the background of the reduction before,
I'm stuck on how to solve the problem of steps 2 and 3 conflict and how to distinguish between clicking on the label and click on the label,
In plain English, that is, to simulate the appearance of a button,
Ask everybody to give directions, thank you

CodePudding user response:

I have a stupid way:
Click a label to put all the label background color reduction and then click set the background color of label

CodePudding user response:

Add a variable to store last click the Label
Each time you click on the Label last click reset Label and the current click on the color of the Label
And set up the last click a Label to the current click the Label of

Just a way of thinking, there are many ways to solve the problem of reference
  • Related