Adding OwnTimer property to marquee. This enables us to use an external timer
and thus use a single timer for multiple marquee.
2 using System.Collections.Generic;
3 using System.ComponentModel;
8 using System.Threading.Tasks;
9 using System.Windows.Forms;
10 using CodeProject.Dialog;
12 namespace SharpDisplayManager
14 public partial class MainForm : Form
16 DateTime LastTickTime;
20 LastTickTime = DateTime.Now;
22 InitializeComponent();
25 private void buttonFont_Click(object sender, EventArgs e)
27 //fontDialog.ShowColor = true;
28 //fontDialog.ShowApply = true;
29 fontDialog.ShowEffects = true;
30 //fontDialog.ShowHelp = true;
32 //fontDlg.MaxSize = 40;
33 //fontDlg.MinSize = 22;
35 //fontDialog.Parent = this;
36 //fontDialog.StartPosition = FormStartPosition.CenterParent;
38 //DlgBox.ShowDialog(fontDialog);
40 //if (fontDialog.ShowDialog(this) != DialogResult.Cancel)
41 if (DlgBox.ShowDialog(fontDialog) != DialogResult.Cancel)
44 MsgBox.Show("MessageBox MsgBox", "MsgBox caption");
46 //MessageBox.Show("Ok");
47 //textBox1.Font = fontDlg.Font;
48 //label1.Font = fontDlg.Font;
49 //textBox1.BackColor = fontDlg.Color;
50 //label1.ForeColor = fontDlg.Color;
54 private void buttonCapture_Click(object sender, EventArgs e)
56 System.Drawing.Bitmap bmp = new System.Drawing.Bitmap(tableLayoutPanel.Width, tableLayoutPanel.Height);
57 tableLayoutPanel.DrawToBitmap(bmp, tableLayoutPanel.ClientRectangle);
58 bmp.Save("c:\\capture.png");
61 private void timer_Tick(object sender, EventArgs e)
63 //Update our animations
64 DateTime NewTickTime = DateTime.Now;
66 marqueeLabelTop.UpdateAnimation(LastTickTime, NewTickTime);
67 marqueeLabelBottom.UpdateAnimation(LastTickTime, NewTickTime);
69 LastTickTime = NewTickTime;