Spiel und Spaß

This commit is contained in:
BlubbFish 2019-05-27 17:27:58 +02:00
parent bd76000628
commit 3fae64086d
6 changed files with 63 additions and 50 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
/.vs
/testapp/bin
/testapp/obj

View File

@ -32,34 +32,46 @@
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
this.components = new System.ComponentModel.Container(); this.components = new System.ComponentModel.Container();
this.trayIcon = new System.Windows.Forms.NotifyIcon(this.components); this.trayIcon = new System.Windows.Forms.NotifyIcon(this.components);
this.SuspendLayout(); this.colorDialog1 = new System.Windows.Forms.ColorDialog();
// this.time = new System.Windows.Forms.Label();
// trayIcon this.SuspendLayout();
// //
this.trayIcon.Text = "trayIcon"; // trayIcon
this.trayIcon.Visible = true; //
// this.trayIcon.Icon = this.getTrayIcon(); this.trayIcon.Text = "trayIcon";
//this.trayIcon.ContextMenuStrip = this.trayIcon.Visible = true;
// //
// Form1 // time
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.time.AutoSize = true;
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.time.Font = new System.Drawing.Font("Microsoft Sans Serif", 48F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ClientSize = new System.Drawing.Size(284, 262); this.time.Location = new System.Drawing.Point(12, 115);
this.Name = "Form1"; this.time.Name = "time";
this.ShowInTaskbar = false; this.time.Size = new System.Drawing.Size(355, 91);
this.Text = "OpenVPN-GUI"; this.time.TabIndex = 0;
this.WindowState = System.Windows.Forms.FormWindowState.Minimized; this.time.Text = "00:00:00";
this.Resize += new System.EventHandler(this.EventHandler_Resize); //
this.ResumeLayout(false); // 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 #endregion
private System.Windows.Forms.NotifyIcon trayIcon; private System.Windows.Forms.NotifyIcon trayIcon;
} private System.Windows.Forms.ColorDialog colorDialog1;
private System.Windows.Forms.Label time;
}
} }

View File

@ -5,31 +5,26 @@ using System.Data;
using System.Drawing; using System.Drawing;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading;
using System.Windows.Forms; using System.Windows.Forms;
namespace testapp namespace testapp {
{ public partial class Form1 : Form {
public partial class Form1 : Form public Form1() {
{ this.InitializeComponent();
public Form1() Thread t = new Thread(this.TimeRunner);
{ t.Start();
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();
}
} }
private void TimeRunner() {
while(true) {
try {
this.time.BeginInvoke((MethodInvoker)delegate {
this.time.Text = DateTime.Now.ToLongTimeString();
});
Thread.Sleep(500);
} catch { }
}
}
}
} }

View File

@ -120,4 +120,7 @@
<metadata name="trayIcon.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="trayIcon.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value> <value>17, 17</value>
</metadata> </metadata>
<metadata name="colorDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>128, 17</value>
</metadata>
</root> </root>

View File

@ -15,7 +15,7 @@
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<PlatformTarget>x86</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType> <DebugType>full</DebugType>
<Optimize>false</Optimize> <Optimize>false</Optimize>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<StartAction>Program</StartAction> <StartAction>Project</StartAction>
<StartProgram>G:\Programme\GoproStudio\GoPro\Tools\GoPro Studio.exe</StartProgram> <StartProgram>G:\Programme\GoproStudio\GoPro\Tools\GoPro Studio.exe</StartProgram>
</PropertyGroup> </PropertyGroup>
</Project> </Project>