Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace DoEventsTest
- {
- public partial class Form1 : Form
- {
- static private Timer timer = new Timer();
- static private int TickCount;
- public Form1()
- {
- InitializeComponent();
- TickCount = 0;
- }
- protected override void OnShown(EventArgs e)
- {
- base.OnShown(e);
- label1.Text = "TestFormRefreshWhenOffScreen";
- timer.Tick += new EventHandler(timer_Tick);
- timer.Interval = 1000;
- timer.Start();
- }
- protected override void OnClosed(EventArgs e)
- {
- base.OnClosed(e);
- timer.Stop();
- }
- protected void timer_Tick(object sender, EventArgs e)
- {
- if (this.Left > -1000)
- this.Left -= 32;
- }
- protected override void OnPaint(PaintEventArgs e)
- {
- base.OnPaint(e);
- Console.WriteLine("Control is now at {0},{1}", Location.X, Location.Y);
- }
- protected override void OnMove(EventArgs e)
- {
- base.OnMove(e);
- Console.WriteLine("Moving");
- Refresh();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement