0

sorry didnt attach the file so here we go!!

Hi Everyone
I'm using a timer to shink a form, i've got it working now, but I don't understand why it didn't work is the first place, or why my change made it work!!???!!!
in line 38 of my code
(Toggle Plain Text)

this.Width -= 30;

this.Width -= 30;
the 30 was originally 10, the form would try shrink then almost get stuck( My best description)
Anyway i've attached the solution if anybody out there knows the answer PLEASE enlighten me
thanks

2
Contributors
1
Reply
2
Views
10 Years
Discussion Span
Last Post by scru
0

Lol this one is funny. See this code:

if ((wide == false) && (this.Width <= 500))
                timer1.Start();
            this.Width += 10;

The C style brackletless block thing only works on the first line after the if statement, the second is not considered part of the if statement and executes everytime the timer ticks, so when you had

this.Width -= 10;

The second line simply negated it.
Fix? Simple; use brackets for that if block :P

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.