How to create a fadein dialog by C#?
-
anybody know? Tuliplanet
-
anybody know? Tuliplanet
-
anybody know? Tuliplanet
it doesn't work! the interval property of timer is 100! this is my code,is there anything wrong? private void button1_Click(object sender, System.EventArgs e) { this.Opacity = 0; timer1.Start(); } private void timer1_Tick(object sender, System.EventArgs e) { this.Opacity = this.Opacity + 5; if(this.Opacity >= 100) { timer1.Stop(); } } Tuliplanet
-
it doesn't work! the interval property of timer is 100! this is my code,is there anything wrong? private void button1_Click(object sender, System.EventArgs e) { this.Opacity = 0; timer1.Start(); } private void timer1_Tick(object sender, System.EventArgs e) { this.Opacity = this.Opacity + 5; if(this.Opacity >= 100) { timer1.Stop(); } } Tuliplanet
Hey.. You have to set the timers interval, when it has to run the method.
Timer newTimer = new Timer(); newTimer.Interval = 1000; // one sec newTimer.Tick += new EventHandler(TheMethod); // .. newTimer.Start();
:)
- Up The Irons, Morten Kristensen
-
it doesn't work! the interval property of timer is 100! this is my code,is there anything wrong? private void button1_Click(object sender, System.EventArgs e) { this.Opacity = 0; timer1.Start(); } private void timer1_Tick(object sender, System.EventArgs e) { this.Opacity = this.Opacity + 5; if(this.Opacity >= 100) { timer1.Stop(); } } Tuliplanet
-
anybody know? Tuliplanet
see my reply!! i set interval=100,but the form just show after a flash! Tuliplanet
-
it doesn't work! the interval property of timer is 100! this is my code,is there anything wrong? private void button1_Click(object sender, System.EventArgs e) { this.Opacity = 0; timer1.Start(); } private void timer1_Tick(object sender, System.EventArgs e) { this.Opacity = this.Opacity + 5; if(this.Opacity >= 100) { timer1.Stop(); } } Tuliplanet
-
see my reply!! i set interval=100,but the form just show after a flash! Tuliplanet
Hehe.. Easy man. Didnt see that sorry. Anyways.. You could also use Thread and ThreadStart?
using System.Threading; //.. ThreadStart ts = new ThreadStart(TheMethod); Thread t = new Thread(ts); t.Start(); // .. public void TheMethod(){ for(int i = 0;i<=100;i++){ Thread.Sleep(10); // Perform Code } }
- Up The Irons, Morten Kristensen
-
Hehe.. Easy man. Didnt see that sorry. Anyways.. You could also use Thread and ThreadStart?
using System.Threading; //.. ThreadStart ts = new ThreadStart(TheMethod); Thread t = new Thread(ts); t.Start(); // .. public void TheMethod(){ for(int i = 0;i<=100;i++){ Thread.Sleep(10); // Perform Code } }
- Up The Irons, Morten Kristensen