From 3fae64086deefffe215a90d0c584b13cb216fdd8 Mon Sep 17 00:00:00 2001 From: BlubbFish Date: Mon, 27 May 2019 17:27:58 +0200 Subject: [PATCH] =?UTF-8?q?Spiel=20und=20Spa=C3=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 ++ testapp/Form1.Designer.cs | 58 ++++++++++++++++++++++--------------- testapp/Form1.cs | 45 +++++++++++++--------------- testapp/Form1.resx | 3 ++ testapp/testapp.csproj | 2 +- testapp/testapp.csproj.user | 2 +- 6 files changed, 63 insertions(+), 50 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..286cf0b --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +/.vs +/testapp/bin +/testapp/obj diff --git a/testapp/Form1.Designer.cs b/testapp/Form1.Designer.cs index 5f60807..6effd98 100644 --- a/testapp/Form1.Designer.cs +++ b/testapp/Form1.Designer.cs @@ -32,34 +32,46 @@ /// private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); - this.trayIcon = new System.Windows.Forms.NotifyIcon(this.components); - this.SuspendLayout(); - // - // trayIcon - // - this.trayIcon.Text = "trayIcon"; - this.trayIcon.Visible = true; - // this.trayIcon.Icon = this.getTrayIcon(); - //this.trayIcon.ContextMenuStrip = - // - // Form1 - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(284, 262); - this.Name = "Form1"; - this.ShowInTaskbar = false; - this.Text = "OpenVPN-GUI"; - this.WindowState = System.Windows.Forms.FormWindowState.Minimized; - this.Resize += new System.EventHandler(this.EventHandler_Resize); - this.ResumeLayout(false); + this.components = new System.ComponentModel.Container(); + this.trayIcon = new System.Windows.Forms.NotifyIcon(this.components); + this.colorDialog1 = new System.Windows.Forms.ColorDialog(); + this.time = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // trayIcon + // + this.trayIcon.Text = "trayIcon"; + this.trayIcon.Visible = true; + // + // time + // + this.time.AutoSize = true; + this.time.Font = new System.Drawing.Font("Microsoft Sans Serif", 48F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.time.Location = new System.Drawing.Point(12, 115); + this.time.Name = "time"; + this.time.Size = new System.Drawing.Size(355, 91); + this.time.TabIndex = 0; + this.time.Text = "00:00:00"; + // + // Form1 + // + this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(399, 299); + this.Controls.Add(this.time); + this.Margin = new System.Windows.Forms.Padding(4); + this.Name = "Form1"; + this.Text = "OpenVPN-GUI"; + this.ResumeLayout(false); + this.PerformLayout(); } #endregion private System.Windows.Forms.NotifyIcon trayIcon; - } + private System.Windows.Forms.ColorDialog colorDialog1; + private System.Windows.Forms.Label time; + } } diff --git a/testapp/Form1.cs b/testapp/Form1.cs index 3f331ec..0e8c567 100644 --- a/testapp/Form1.cs +++ b/testapp/Form1.cs @@ -5,31 +5,26 @@ using System.Data; using System.Drawing; using System.Linq; using System.Text; +using System.Threading; using System.Windows.Forms; -namespace testapp -{ - public partial class Form1 : Form - { - public Form1() - { - InitializeComponent(); - UInt16 a = 0x1234; - byte h = (byte)(a >> 8); - byte l = (byte)a; - Console.WriteLine(h + " " + l); - } - private void EventHandler_Resize(object sender, System.EventArgs e) - { - if (this.WindowState == FormWindowState.Minimized) - { - this.ShowInTaskbar = false; - this.WindowState = FormWindowState.Minimized; - } - } - private System.Drawing.Icon getTrayIcon() - { - throw new System.NotImplementedException(); - } +namespace testapp { + public partial class Form1 : Form { + public Form1() { + this.InitializeComponent(); + Thread t = new Thread(this.TimeRunner); + t.Start(); } -} + + private void TimeRunner() { + while(true) { + try { + this.time.BeginInvoke((MethodInvoker)delegate { + this.time.Text = DateTime.Now.ToLongTimeString(); + }); + Thread.Sleep(500); + } catch { } + } + } + } +} \ No newline at end of file diff --git a/testapp/Form1.resx b/testapp/Form1.resx index 55df86a..a0fd775 100644 --- a/testapp/Form1.resx +++ b/testapp/Form1.resx @@ -120,4 +120,7 @@ 17, 17 + + 128, 17 + \ No newline at end of file diff --git a/testapp/testapp.csproj b/testapp/testapp.csproj index 0ef3dfb..0bcd93d 100644 --- a/testapp/testapp.csproj +++ b/testapp/testapp.csproj @@ -15,7 +15,7 @@ 512 - x86 + AnyCPU true full false diff --git a/testapp/testapp.csproj.user b/testapp/testapp.csproj.user index 1ce79b0..9539600 100644 --- a/testapp/testapp.csproj.user +++ b/testapp/testapp.csproj.user @@ -1,7 +1,7 @@  - Program + Project G:\Programme\GoproStudio\GoPro\Tools\GoPro Studio.exe \ No newline at end of file