sl@0: using System; sl@0: using System.Collections.Generic; sl@0: using System.ComponentModel; sl@0: using System.Data; sl@0: using System.Drawing; sl@0: using System.Linq; sl@0: using System.Text; sl@0: using System.Threading.Tasks; sl@0: using System.Windows.Forms; sl@0: using CodeProject.Dialog; sl@0: sl@0: namespace SharpDisplayManager sl@0: { sl@0: public partial class MainForm : Form sl@0: { sl@2: DateTime LastTickTime; sl@3: Display iDisplay; sl@2: sl@0: public MainForm() sl@0: { sl@2: LastTickTime = DateTime.Now; sl@3: iDisplay = new Display(); sl@2: sl@0: InitializeComponent(); sl@0: } sl@0: sl@0: private void buttonFont_Click(object sender, EventArgs e) sl@0: { sl@0: //fontDialog.ShowColor = true; sl@0: //fontDialog.ShowApply = true; sl@0: fontDialog.ShowEffects = true; sl@0: //fontDialog.ShowHelp = true; sl@0: sl@0: //fontDlg.MaxSize = 40; sl@0: //fontDlg.MinSize = 22; sl@0: sl@0: //fontDialog.Parent = this; sl@0: //fontDialog.StartPosition = FormStartPosition.CenterParent; sl@0: sl@0: //DlgBox.ShowDialog(fontDialog); sl@0: sl@0: //if (fontDialog.ShowDialog(this) != DialogResult.Cancel) sl@0: if (DlgBox.ShowDialog(fontDialog) != DialogResult.Cancel) sl@0: { sl@0: sl@0: MsgBox.Show("MessageBox MsgBox", "MsgBox caption"); sl@0: sl@0: //MessageBox.Show("Ok"); sl@0: //textBox1.Font = fontDlg.Font; sl@0: //label1.Font = fontDlg.Font; sl@0: //textBox1.BackColor = fontDlg.Color; sl@0: //label1.ForeColor = fontDlg.Color; sl@0: } sl@0: } sl@0: sl@0: private void buttonCapture_Click(object sender, EventArgs e) sl@0: { sl@0: System.Drawing.Bitmap bmp = new System.Drawing.Bitmap(tableLayoutPanel.Width, tableLayoutPanel.Height); sl@0: tableLayoutPanel.DrawToBitmap(bmp, tableLayoutPanel.ClientRectangle); sl@0: bmp.Save("c:\\capture.png"); sl@0: } sl@2: sl@2: private void timer_Tick(object sender, EventArgs e) sl@2: { sl@2: //Update our animations sl@2: DateTime NewTickTime = DateTime.Now; sl@2: sl@2: marqueeLabelTop.UpdateAnimation(LastTickTime, NewTickTime); sl@2: marqueeLabelBottom.UpdateAnimation(LastTickTime, NewTickTime); sl@2: sl@2: LastTickTime = NewTickTime; sl@2: } sl@3: sl@3: private void buttonOpen_Click(object sender, EventArgs e) sl@3: { sl@3: if (iDisplay.Open()) sl@3: { sl@3: trackBarBrightness.Minimum = iDisplay.MinBrightness(); sl@3: trackBarBrightness.Maximum = iDisplay.MaxBrightness(); sl@3: } sl@3: sl@3: } sl@3: sl@3: private void buttonClose_Click(object sender, EventArgs e) sl@3: { sl@3: iDisplay.Close(); sl@3: } sl@3: sl@3: private void buttonClear_Click(object sender, EventArgs e) sl@3: { sl@3: iDisplay.Clear(); sl@3: iDisplay.SwapBuffers(); sl@3: } sl@3: sl@3: private void buttonFill_Click(object sender, EventArgs e) sl@3: { sl@3: iDisplay.Fill(); sl@3: iDisplay.SwapBuffers(); sl@3: } sl@3: sl@3: private void trackBarBrightness_Scroll(object sender, EventArgs e) sl@3: { sl@3: iDisplay.SetBrightness(trackBarBrightness.Value); sl@3: } sl@0: } sl@0: }