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

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.