How do I change Line Width on Canvas using [+/-] buttons?

So, I was wondering how to increase and decrease line thickness for drawing on canvas using plus and minus buttons? I already have the plus and minus buttons. I already have a label by default starting at 5. But the buttons are not functional and the label is still at 5. Once I click the plus button, it needs to increase by 1, (6,7,8,9,10) to a Max line width of (10). And If I hit the minus button, (4,3,2,1) to a Min line width of 1. I believe we have to use if statements. How do we build this?

This should do it for you (Label1.Text is for displaying the Line Width value)


1 Like

So we don't need variables right?

You can use a variable if you want, I used the Label.text which serves as a "variable" and displays the line width value

1 Like

Would I initialize the global variable to "5" or something else?

It's not working. when i click the plus and minus buttons it is not going up and down by 1

In my example just set Label1.text value to 5.

Its not working doesn't help :wink:
Show your blocks

or like this with a variable ?

Ok never mind.. I got it to work. Thank you so much for the help!

To change the thickness of a line that has already been drawn, you must draw the lines again with a different thickness.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.