Newbie Spellweaver
- Joined
- Sep 21, 2014
- Messages
- 33
- Reaction score
- 0
C# Need help
Any Idea, how to achieve smooth transition in c#? Because its so flickery when you put an image as background on a form.
heres my code:
View attachment SlideFormAnimation.rar
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace SlideFormAnimation
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
this.tm2.Enabled = true;
gbox1.Visible = false;
}
int tx1 = 49;
private void timer1_Tick(object sender, EventArgs e)
{
if (tx1 > 300)
{
timer1.Stop();
}
else
{
this.gbox1.Size = new Size(this.gbox1.Width,tx1);
tx1 += 2;
gbox1.Show();
}
}
private void timer2_Tick(object sender, EventArgs e)
{
if (this.Height >= 400) this.tm2.Enabled = false;
else this.Height += 66;
timer1.Start();
}
}
}
Any Idea, how to achieve smooth transition in c#? Because its so flickery when you put an image as background on a form.
heres my code:
View attachment SlideFormAnimation.rar
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace SlideFormAnimation
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
this.tm2.Enabled = true;
gbox1.Visible = false;
}
int tx1 = 49;
private void timer1_Tick(object sender, EventArgs e)
{
if (tx1 > 300)
{
timer1.Stop();
}
else
{
this.gbox1.Size = new Size(this.gbox1.Width,tx1);
tx1 += 2;
gbox1.Show();
}
}
private void timer2_Tick(object sender, EventArgs e)
{
if (this.Height >= 400) this.tm2.Enabled = false;
else this.Height += 66;
timer1.Start();
}
}
}
Attachments
You must be registered for see attachments list