diff --git a/QRreaderWindowsForms/QRreaderWindowsForms.sln b/QRreaderWindowsForms/QRreaderWindowsForms.sln
new file mode 100644
index 0000000..0fd659e
--- /dev/null
+++ b/QRreaderWindowsForms/QRreaderWindowsForms.sln
@@ -0,0 +1,25 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.30907.101
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "QRreaderWindowsForms", "QRreaderWindowsForms\QRreaderWindowsForms.csproj", "{08DA75D2-14CD-4C6E-A816-DE45891C492F}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {08DA75D2-14CD-4C6E-A816-DE45891C492F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {08DA75D2-14CD-4C6E-A816-DE45891C492F}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {08DA75D2-14CD-4C6E-A816-DE45891C492F}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {08DA75D2-14CD-4C6E-A816-DE45891C492F}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {49FA3577-D4F1-4B1C-914E-C1A09F5C7C50}
+ EndGlobalSection
+EndGlobal
diff --git a/QRreaderWindowsForms/QRreaderWindowsForms/App.config b/QRreaderWindowsForms/QRreaderWindowsForms/App.config
new file mode 100644
index 0000000..56efbc7
--- /dev/null
+++ b/QRreaderWindowsForms/QRreaderWindowsForms/App.config
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/QRreaderWindowsForms/QRreaderWindowsForms/Form1.Designer.cs b/QRreaderWindowsForms/QRreaderWindowsForms/Form1.Designer.cs
new file mode 100644
index 0000000..53c9b13
--- /dev/null
+++ b/QRreaderWindowsForms/QRreaderWindowsForms/Form1.Designer.cs
@@ -0,0 +1,126 @@
+
+namespace QRreaderWindowsForms
+{
+ partial class Form1
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.components = new System.ComponentModel.Container();
+ this.cboCamera = new System.Windows.Forms.ComboBox();
+ this.btnStart = new System.Windows.Forms.Button();
+ this.pictureBox1 = new System.Windows.Forms.PictureBox();
+ this.btnDecode = new System.Windows.Forms.Button();
+ this.timer1 = new System.Windows.Forms.Timer(this.components);
+ this.txtResult = new System.Windows.Forms.ListBox();
+ ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
+ this.SuspendLayout();
+ //
+ // cboCamera
+ //
+ this.cboCamera.Dock = System.Windows.Forms.DockStyle.Top;
+ this.cboCamera.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.cboCamera.FormattingEnabled = true;
+ this.cboCamera.Location = new System.Drawing.Point(0, 0);
+ this.cboCamera.Name = "cboCamera";
+ this.cboCamera.Size = new System.Drawing.Size(534, 32);
+ this.cboCamera.TabIndex = 0;
+ //
+ // btnStart
+ //
+ this.btnStart.Location = new System.Drawing.Point(330, 207);
+ this.btnStart.Name = "btnStart";
+ this.btnStart.Size = new System.Drawing.Size(100, 35);
+ this.btnStart.TabIndex = 1;
+ this.btnStart.Text = "Start";
+ this.btnStart.UseVisualStyleBackColor = true;
+ this.btnStart.Click += new System.EventHandler(this.btnStart_Click);
+ //
+ // pictureBox1
+ //
+ this.pictureBox1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
+ this.pictureBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+ this.pictureBox1.Dock = System.Windows.Forms.DockStyle.Left;
+ this.pictureBox1.Location = new System.Drawing.Point(0, 32);
+ this.pictureBox1.Name = "pictureBox1";
+ this.pictureBox1.Size = new System.Drawing.Size(328, 307);
+ this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
+ this.pictureBox1.TabIndex = 2;
+ this.pictureBox1.TabStop = false;
+ //
+ // btnDecode
+ //
+ this.btnDecode.Location = new System.Drawing.Point(432, 207);
+ this.btnDecode.Name = "btnDecode";
+ this.btnDecode.Size = new System.Drawing.Size(100, 35);
+ this.btnDecode.TabIndex = 3;
+ this.btnDecode.Text = "Decode";
+ this.btnDecode.UseVisualStyleBackColor = true;
+ this.btnDecode.Click += new System.EventHandler(this.btnDecode_Click);
+ //
+ // timer1
+ //
+ this.timer1.Interval = 1000;
+ this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
+ //
+ // txtResult
+ //
+ this.txtResult.FormattingEnabled = true;
+ this.txtResult.Location = new System.Drawing.Point(328, 32);
+ this.txtResult.Name = "txtResult";
+ this.txtResult.Size = new System.Drawing.Size(206, 173);
+ this.txtResult.TabIndex = 4;
+ //
+ // Form1
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(534, 339);
+ this.Controls.Add(this.txtResult);
+ this.Controls.Add(this.btnDecode);
+ this.Controls.Add(this.pictureBox1);
+ this.Controls.Add(this.btnStart);
+ this.Controls.Add(this.cboCamera);
+ this.Name = "Form1";
+ this.Text = "Form1";
+ this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing);
+ this.Load += new System.EventHandler(this.Form1_Load);
+ ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.ComboBox cboCamera;
+ private System.Windows.Forms.Button btnStart;
+ private System.Windows.Forms.PictureBox pictureBox1;
+ private System.Windows.Forms.Button btnDecode;
+ private System.Windows.Forms.Timer timer1;
+ private System.Windows.Forms.ListBox txtResult;
+ }
+}
+
diff --git a/QRreaderWindowsForms/QRreaderWindowsForms/Form1.cs b/QRreaderWindowsForms/QRreaderWindowsForms/Form1.cs
new file mode 100644
index 0000000..96eb44c
--- /dev/null
+++ b/QRreaderWindowsForms/QRreaderWindowsForms/Form1.cs
@@ -0,0 +1,79 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+
+// include the libraries
+using AForge.Video;
+using AForge.Video.DirectShow;
+using ZXing;
+
+
+namespace QRreaderWindowsForms
+{
+ public partial class Form1 : Form
+ {
+ // foxlearn.com/windows-forms/qr-code-scanner-using-camera-in-csharp-380.html
+
+
+ FilterInfoCollection filterInfoCollection;
+ VideoCaptureDevice videoCaptureDevice;
+
+ public Form1()
+ {
+ InitializeComponent();
+ }
+
+ private void Form1_Load(object sender, EventArgs e)
+ {
+ // this will list the available cameras
+ filterInfoCollection = new FilterInfoCollection(FilterCategory.VideoInputDevice);
+ foreach (FilterInfo Device in filterInfoCollection)
+ cboCamera.Items.Add(Device.Name);
+ cboCamera.SelectedIndex = 0;
+ videoCaptureDevice = new VideoCaptureDevice();
+ }
+
+ private void btnStart_Click(object sender, EventArgs e)
+ {
+ // start the camera device
+ videoCaptureDevice = new VideoCaptureDevice(filterInfoCollection[cboCamera.SelectedIndex].MonikerString);
+ videoCaptureDevice.NewFrame += FinalFrame_NewFrame;
+ videoCaptureDevice.Start();
+ }
+
+ private void FinalFrame_NewFrame(object sender, NewFrameEventArgs eventArgs)
+ {
+ // show the video in the picturebox
+ pictureBox1.Image = (Bitmap)eventArgs.Frame.Clone();
+ }
+
+ private void Form1_FormClosing(object sender, FormClosingEventArgs e)
+ {
+ // close the camera device when the app is closed
+ if (videoCaptureDevice.IsRunning == true)
+ videoCaptureDevice.Stop();
+ }
+
+ private void btnDecode_Click(object sender, EventArgs e)
+ {
+ // start the decoder looking for QR codes
+ timer1.Start();
+ }
+
+ private void timer1_Tick(object sender, EventArgs e)
+ {
+ // try and detect a barcode/qrcode in the image frame
+ BarcodeReader Reader = new BarcodeReader();
+ Result result = Reader.Decode((Bitmap)pictureBox1.Image);
+ if (result != null)
+ txtResult.Items.Add(result.Text);
+ }
+ }
+}
diff --git a/QRreaderWindowsForms/QRreaderWindowsForms/Form1.resx b/QRreaderWindowsForms/QRreaderWindowsForms/Form1.resx
new file mode 100644
index 0000000..1f666f2
--- /dev/null
+++ b/QRreaderWindowsForms/QRreaderWindowsForms/Form1.resx
@@ -0,0 +1,123 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ 17, 17
+
+
\ No newline at end of file
diff --git a/QRreaderWindowsForms/QRreaderWindowsForms/Program.cs b/QRreaderWindowsForms/QRreaderWindowsForms/Program.cs
new file mode 100644
index 0000000..ebedffc
--- /dev/null
+++ b/QRreaderWindowsForms/QRreaderWindowsForms/Program.cs
@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace QRreaderWindowsForms
+{
+ static class Program
+ {
+ ///
+ /// The main entry point for the application.
+ ///
+ [STAThread]
+ static void Main()
+ {
+ Application.EnableVisualStyles();
+ Application.SetCompatibleTextRenderingDefault(false);
+ Application.Run(new Form1());
+ }
+ }
+}
diff --git a/QRreaderWindowsForms/QRreaderWindowsForms/Properties/AssemblyInfo.cs b/QRreaderWindowsForms/QRreaderWindowsForms/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..2555c06
--- /dev/null
+++ b/QRreaderWindowsForms/QRreaderWindowsForms/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("QRreaderWindowsForms")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("QRreaderWindowsForms")]
+[assembly: AssemblyCopyright("Copyright © 2021")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("08da75d2-14cd-4c6e-a816-de45891c492f")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/QRreaderWindowsForms/QRreaderWindowsForms/Properties/Resources.Designer.cs b/QRreaderWindowsForms/QRreaderWindowsForms/Properties/Resources.Designer.cs
new file mode 100644
index 0000000..babd9f5
--- /dev/null
+++ b/QRreaderWindowsForms/QRreaderWindowsForms/Properties/Resources.Designer.cs
@@ -0,0 +1,70 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+
+namespace QRreaderWindowsForms.Properties
+{
+ ///
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ ///
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // class via a tool like ResGen or Visual Studio.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Resources
+ {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Resources()
+ {
+ }
+
+ ///
+ /// Returns the cached ResourceManager instance used by this class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager
+ {
+ get
+ {
+ if ((resourceMan == null))
+ {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("QRreaderWindowsForms.Properties.Resources", typeof(Resources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture
+ {
+ get
+ {
+ return resourceCulture;
+ }
+ set
+ {
+ resourceCulture = value;
+ }
+ }
+ }
+}
diff --git a/QRreaderWindowsForms/QRreaderWindowsForms/Properties/Resources.resx b/QRreaderWindowsForms/QRreaderWindowsForms/Properties/Resources.resx
new file mode 100644
index 0000000..af7dbeb
--- /dev/null
+++ b/QRreaderWindowsForms/QRreaderWindowsForms/Properties/Resources.resx
@@ -0,0 +1,117 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/QRreaderWindowsForms/QRreaderWindowsForms/Properties/Settings.Designer.cs b/QRreaderWindowsForms/QRreaderWindowsForms/Properties/Settings.Designer.cs
new file mode 100644
index 0000000..cd225c9
--- /dev/null
+++ b/QRreaderWindowsForms/QRreaderWindowsForms/Properties/Settings.Designer.cs
@@ -0,0 +1,29 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+
+namespace QRreaderWindowsForms.Properties
+{
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
+ internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
+ {
+
+ private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+
+ public static Settings Default
+ {
+ get
+ {
+ return defaultInstance;
+ }
+ }
+ }
+}
diff --git a/QRreaderWindowsForms/QRreaderWindowsForms/Properties/Settings.settings b/QRreaderWindowsForms/QRreaderWindowsForms/Properties/Settings.settings
new file mode 100644
index 0000000..3964565
--- /dev/null
+++ b/QRreaderWindowsForms/QRreaderWindowsForms/Properties/Settings.settings
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/QRreaderWindowsForms/QRreaderWindowsForms/QRreaderWindowsForms.csproj b/QRreaderWindowsForms/QRreaderWindowsForms/QRreaderWindowsForms.csproj
new file mode 100644
index 0000000..114f817
--- /dev/null
+++ b/QRreaderWindowsForms/QRreaderWindowsForms/QRreaderWindowsForms.csproj
@@ -0,0 +1,99 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {08DA75D2-14CD-4C6E-A816-DE45891C492F}
+ WinExe
+ QRreaderWindowsForms
+ QRreaderWindowsForms
+ v4.7.2
+ 512
+ true
+ true
+
+
+ AnyCPU
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ AnyCPU
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+ ..\packages\AForge.2.2.5\lib\AForge.dll
+
+
+ ..\packages\AForge.Video.2.2.5\lib\AForge.Video.dll
+
+
+ ..\packages\AForge.Video.DirectShow.2.2.5\lib\AForge.Video.DirectShow.dll
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ..\packages\ZXing.Net.0.16.6\lib\net47\zxing.dll
+
+
+ ..\packages\ZXing.Net.0.16.6\lib\net47\zxing.presentation.dll
+
+
+
+
+ Form
+
+
+ Form1.cs
+
+
+
+
+ Form1.cs
+
+
+ ResXFileCodeGenerator
+ Resources.Designer.cs
+ Designer
+
+
+ True
+ Resources.resx
+
+
+
+ SettingsSingleFileGenerator
+ Settings.Designer.cs
+
+
+ True
+ Settings.settings
+ True
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/QRreaderWindowsForms/QRreaderWindowsForms/packages.config b/QRreaderWindowsForms/QRreaderWindowsForms/packages.config
new file mode 100644
index 0000000..90d3684
--- /dev/null
+++ b/QRreaderWindowsForms/QRreaderWindowsForms/packages.config
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/WindowsFormsPopupKeyboard/WindowsFormsApplication3/App.config b/WindowsFormsPopupKeyboard/WindowsFormsApplication3/App.config
new file mode 100644
index 0000000..88fa402
--- /dev/null
+++ b/WindowsFormsPopupKeyboard/WindowsFormsApplication3/App.config
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/WindowsFormsPopupKeyboard/WindowsFormsApplication3/Form1.Designer.cs b/WindowsFormsPopupKeyboard/WindowsFormsApplication3/Form1.Designer.cs
new file mode 100644
index 0000000..4327c00
--- /dev/null
+++ b/WindowsFormsPopupKeyboard/WindowsFormsApplication3/Form1.Designer.cs
@@ -0,0 +1,86 @@
+namespace WindowsFormsPopupKeyboard
+{
+ partial class Form1
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.textBox2 = new System.Windows.Forms.TextBox();
+ this.label1 = new System.Windows.Forms.Label();
+ this.textBox1 = new System.Windows.Forms.TextBox();
+ this.SuspendLayout();
+ //
+ // textBox2
+ //
+ this.textBox2.Location = new System.Drawing.Point(112, 139);
+ this.textBox2.Margin = new System.Windows.Forms.Padding(2);
+ this.textBox2.Name = "textBox2";
+ this.textBox2.Size = new System.Drawing.Size(76, 20);
+ this.textBox2.TabIndex = 1;
+ this.textBox2.GotFocus += new System.EventHandler(this.textBox_GotFocus);
+ //
+ // label1
+ //
+ this.label1.Location = new System.Drawing.Point(109, 173);
+ this.label1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+ this.label1.Name = "label1";
+ this.label1.Size = new System.Drawing.Size(123, 48);
+ this.label1.TabIndex = 2;
+ this.label1.Text = "Click on a textbox above to launch the popup keyboard";
+ //
+ // textBox1
+ //
+ this.textBox1.Location = new System.Drawing.Point(112, 88);
+ this.textBox1.Margin = new System.Windows.Forms.Padding(2);
+ this.textBox1.Name = "textBox1";
+ this.textBox1.Size = new System.Drawing.Size(76, 20);
+ this.textBox1.TabIndex = 4;
+ this.textBox1.GotFocus += new System.EventHandler(this.textBox_GotFocus);
+ //
+ // Form1
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(568, 458);
+ this.Controls.Add(this.textBox1);
+ this.Controls.Add(this.label1);
+ this.Controls.Add(this.textBox2);
+ this.Margin = new System.Windows.Forms.Padding(2);
+ this.Name = "Form1";
+ this.Text = "Form1";
+ this.Load += new System.EventHandler(this.Form1_Load);
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+ public System.Windows.Forms.TextBox textBox2;
+ private System.Windows.Forms.Label label1;
+ public System.Windows.Forms.TextBox textBox1;
+ }
+}
+
diff --git a/WindowsFormsPopupKeyboard/WindowsFormsApplication3/Form1.cs b/WindowsFormsPopupKeyboard/WindowsFormsApplication3/Form1.cs
new file mode 100644
index 0000000..f278e9d
--- /dev/null
+++ b/WindowsFormsPopupKeyboard/WindowsFormsApplication3/Form1.cs
@@ -0,0 +1,59 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace WindowsFormsPopupKeyboard
+{
+ public partial class Form1 : Form
+ {
+ Keyboard keyboard;
+ public Form1()
+ {
+ InitializeComponent();
+ }
+
+ /******************************************
+ * I had to hook up the textBox_GotFocus event handler method manuall in the Form's
+ * Designer.cs file using:
+ *
+ * this.textBox1.GotFocus += new System.EventHandler(this.textBox_GotFocus);
+ *
+ *****************************************/
+ private void textBox_GotFocus(Object sender, EventArgs e)
+ {
+ TextBox tb = (TextBox)sender; // take a copy of the object reference for the particular textbox pressed
+
+ label1.Text = "TextBox " + tb.Name + " GotFocus " + DateTime.Now.ToString(); // just some debugging to see which textbox has focus
+
+ if (keyboard == null) // check if the keyboard is already created
+ {
+ keyboard = new Keyboard(); // no keyboard so create an instance of one
+ keyboard.FormClosed += delegate
+ {
+ keyboard = null; // when the keyboard is closed, dispose of the keyboard instance
+ this.ActiveControl = label1; // when the keyboard is closed, reset focus to the dummy label else
+ // it will give focus to a textbox which would trigger the event to
+ // make another keyboard appear.
+ };
+ }
+ keyboard.setTextBoxForOutput(tb); // tell the keyboard which textbox to send its characters too
+ keyboard.Show(); // show the keyboard
+
+ keyboard.Left = this.Left + tb.Left + tb.Width + 30; // re-position the keyboard form to be next to
+ keyboard.Top = this.Top + tb.Top + tb.Height + 11; // the textbox that recieves its input.
+ }
+
+ private void Form1_Load(object sender, EventArgs e)
+ {
+ this.ActiveControl = label1; // when the form loads, direct focus to a label so that a textbox
+ // doesn't get focus by default and trigger the GotFocus event (which
+ // would show the keyboard before we needed it)
+ }
+ }
+}
diff --git a/WindowsFormsPopupKeyboard/WindowsFormsApplication3/Form1.resx b/WindowsFormsPopupKeyboard/WindowsFormsApplication3/Form1.resx
new file mode 100644
index 0000000..1af7de1
--- /dev/null
+++ b/WindowsFormsPopupKeyboard/WindowsFormsApplication3/Form1.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/WindowsFormsPopupKeyboard/WindowsFormsApplication3/Program.cs b/WindowsFormsPopupKeyboard/WindowsFormsApplication3/Program.cs
new file mode 100644
index 0000000..225f99a
--- /dev/null
+++ b/WindowsFormsPopupKeyboard/WindowsFormsApplication3/Program.cs
@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace WindowsFormsPopupKeyboard
+{
+ static class Program
+ {
+ ///
+ /// The main entry point for the application.
+ ///
+ [STAThread]
+ static void Main()
+ {
+ Application.EnableVisualStyles();
+ Application.SetCompatibleTextRenderingDefault(false);
+ Application.Run(new Form1());
+ }
+ }
+}
diff --git a/WindowsFormsPopupKeyboard/WindowsFormsApplication3/Properties/AssemblyInfo.cs b/WindowsFormsPopupKeyboard/WindowsFormsApplication3/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..3c6de22
--- /dev/null
+++ b/WindowsFormsPopupKeyboard/WindowsFormsApplication3/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("WindowsFormsApplication3")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("WindowsFormsApplication3")]
+[assembly: AssemblyCopyright("Copyright © 2017")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("100e030a-31a8-4080-a090-9c130a233e81")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/WindowsFormsPopupKeyboard/WindowsFormsApplication3/Properties/Resources.Designer.cs b/WindowsFormsPopupKeyboard/WindowsFormsApplication3/Properties/Resources.Designer.cs
new file mode 100644
index 0000000..fe162a2
--- /dev/null
+++ b/WindowsFormsPopupKeyboard/WindowsFormsApplication3/Properties/Resources.Designer.cs
@@ -0,0 +1,71 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace WindowsFormsPopupKeyboard.Properties
+{
+
+
+ ///
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ ///
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // class via a tool like ResGen or Visual Studio.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Resources
+ {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Resources()
+ {
+ }
+
+ ///
+ /// Returns the cached ResourceManager instance used by this class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager
+ {
+ get
+ {
+ if ((resourceMan == null))
+ {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WindowsFormsApplication3.Properties.Resources", typeof(Resources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture
+ {
+ get
+ {
+ return resourceCulture;
+ }
+ set
+ {
+ resourceCulture = value;
+ }
+ }
+ }
+}
diff --git a/WindowsFormsPopupKeyboard/WindowsFormsApplication3/Properties/Resources.resx b/WindowsFormsPopupKeyboard/WindowsFormsApplication3/Properties/Resources.resx
new file mode 100644
index 0000000..af7dbeb
--- /dev/null
+++ b/WindowsFormsPopupKeyboard/WindowsFormsApplication3/Properties/Resources.resx
@@ -0,0 +1,117 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/WindowsFormsPopupKeyboard/WindowsFormsApplication3/Properties/Settings.Designer.cs b/WindowsFormsPopupKeyboard/WindowsFormsApplication3/Properties/Settings.Designer.cs
new file mode 100644
index 0000000..efb7cbf
--- /dev/null
+++ b/WindowsFormsPopupKeyboard/WindowsFormsApplication3/Properties/Settings.Designer.cs
@@ -0,0 +1,30 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace WindowsFormsPopupKeyboard.Properties
+{
+
+
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
+ internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
+ {
+
+ private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+
+ public static Settings Default
+ {
+ get
+ {
+ return defaultInstance;
+ }
+ }
+ }
+}
diff --git a/WindowsFormsPopupKeyboard/WindowsFormsApplication3/Properties/Settings.settings b/WindowsFormsPopupKeyboard/WindowsFormsApplication3/Properties/Settings.settings
new file mode 100644
index 0000000..3964565
--- /dev/null
+++ b/WindowsFormsPopupKeyboard/WindowsFormsApplication3/Properties/Settings.settings
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/WindowsFormsPopupKeyboard/WindowsFormsApplication3/WindowsFormsPopupKeyboard.csproj b/WindowsFormsPopupKeyboard/WindowsFormsApplication3/WindowsFormsPopupKeyboard.csproj
new file mode 100644
index 0000000..801cf96
--- /dev/null
+++ b/WindowsFormsPopupKeyboard/WindowsFormsApplication3/WindowsFormsPopupKeyboard.csproj
@@ -0,0 +1,99 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {100E030A-31A8-4080-A090-9C130A233E81}
+ WinExe
+ Properties
+ WindowsFormsApplication3
+ WindowsFormsApplication3
+ v4.5.2
+ 512
+ true
+
+
+ AnyCPU
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ AnyCPU
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Form
+
+
+ Form1.cs
+
+
+ Form
+
+
+ keyboard.cs
+
+
+
+
+ Form1.cs
+
+
+ keyboard.cs
+
+
+ ResXFileCodeGenerator
+ Resources.Designer.cs
+ Designer
+
+
+ True
+ Resources.resx
+
+
+ SettingsSingleFileGenerator
+ Settings.Designer.cs
+
+
+ True
+ Settings.settings
+ True
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/WindowsFormsPopupKeyboard/WindowsFormsApplication3/keyboard.Designer.cs b/WindowsFormsPopupKeyboard/WindowsFormsApplication3/keyboard.Designer.cs
new file mode 100644
index 0000000..0805b2d
--- /dev/null
+++ b/WindowsFormsPopupKeyboard/WindowsFormsApplication3/keyboard.Designer.cs
@@ -0,0 +1,93 @@
+namespace WindowsFormsPopupKeyboard
+{
+ partial class Keyboard
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.buttonB = new System.Windows.Forms.Button();
+ this.buttonA = new System.Windows.Forms.Button();
+ this.buttonC = new System.Windows.Forms.Button();
+ this.SuspendLayout();
+ //
+ // buttonB
+ //
+ this.buttonB.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.buttonB.Location = new System.Drawing.Point(87, 18);
+ this.buttonB.Margin = new System.Windows.Forms.Padding(2);
+ this.buttonB.Name = "buttonB";
+ this.buttonB.Size = new System.Drawing.Size(46, 38);
+ this.buttonB.TabIndex = 0;
+ this.buttonB.Text = "B";
+ this.buttonB.UseVisualStyleBackColor = true;
+ this.buttonB.Click += new System.EventHandler(this.button_Click);
+ //
+ // buttonA
+ //
+ this.buttonA.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.buttonA.Location = new System.Drawing.Point(25, 18);
+ this.buttonA.Margin = new System.Windows.Forms.Padding(2);
+ this.buttonA.Name = "buttonA";
+ this.buttonA.Size = new System.Drawing.Size(46, 38);
+ this.buttonA.TabIndex = 1;
+ this.buttonA.Text = "A";
+ this.buttonA.UseVisualStyleBackColor = true;
+ this.buttonA.Click += new System.EventHandler(this.button_Click);
+ //
+ // buttonC
+ //
+ this.buttonC.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.buttonC.Location = new System.Drawing.Point(150, 18);
+ this.buttonC.Margin = new System.Windows.Forms.Padding(2);
+ this.buttonC.Name = "buttonC";
+ this.buttonC.Size = new System.Drawing.Size(46, 38);
+ this.buttonC.TabIndex = 3;
+ this.buttonC.Text = "C";
+ this.buttonC.UseVisualStyleBackColor = true;
+ this.buttonC.Click += new System.EventHandler(this.button_Click);
+ //
+ // Keyboard
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(626, 213);
+ this.Controls.Add(this.buttonC);
+ this.Controls.Add(this.buttonA);
+ this.Controls.Add(this.buttonB);
+ this.Margin = new System.Windows.Forms.Padding(2);
+ this.Name = "Keyboard";
+ this.Text = "keyboard";
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Button buttonB;
+ private System.Windows.Forms.Button buttonA;
+ private System.Windows.Forms.Button buttonC;
+ }
+}
\ No newline at end of file
diff --git a/WindowsFormsPopupKeyboard/WindowsFormsApplication3/keyboard.cs b/WindowsFormsPopupKeyboard/WindowsFormsApplication3/keyboard.cs
new file mode 100644
index 0000000..86a298b
--- /dev/null
+++ b/WindowsFormsPopupKeyboard/WindowsFormsApplication3/keyboard.cs
@@ -0,0 +1,35 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace WindowsFormsPopupKeyboard
+{
+ public partial class Keyboard : Form
+ {
+ TextBox tt;
+
+ public Keyboard()
+ {
+ InitializeComponent();
+ this.TopMost = true; // make the keyboard always in front of the other forms
+ }
+
+ public void setTextBoxForOutput(TextBox t)
+ {
+ tt = t; //
+ }
+
+
+ private void button_Click(object sender, EventArgs e)
+ {
+
+ tt.Text += ((Button)sender).Text;
+ }
+ }
+}
diff --git a/WindowsFormsPopupKeyboard/WindowsFormsApplication3/keyboard.resx b/WindowsFormsPopupKeyboard/WindowsFormsApplication3/keyboard.resx
new file mode 100644
index 0000000..1af7de1
--- /dev/null
+++ b/WindowsFormsPopupKeyboard/WindowsFormsApplication3/keyboard.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/WindowsFormsPopupKeyboard/WindowsFormsPopupKeyboard.sln b/WindowsFormsPopupKeyboard/WindowsFormsPopupKeyboard.sln
new file mode 100644
index 0000000..290615a
--- /dev/null
+++ b/WindowsFormsPopupKeyboard/WindowsFormsPopupKeyboard.sln
@@ -0,0 +1,22 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 14
+VisualStudioVersion = 14.0.25420.1
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WindowsFormsPopupKeyboard", "WindowsFormsApplication3\WindowsFormsPopupKeyboard.csproj", "{100E030A-31A8-4080-A090-9C130A233E81}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {100E030A-31A8-4080-A090-9C130A233E81}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {100E030A-31A8-4080-A090-9C130A233E81}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {100E030A-31A8-4080-A090-9C130A233E81}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {100E030A-31A8-4080-A090-9C130A233E81}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/advancedpictureviewer/Form1.Designer.cs b/advancedpictureviewer/Form1.Designer.cs
index ce22b0b..1e48407 100644
--- a/advancedpictureviewer/Form1.Designer.cs
+++ b/advancedpictureviewer/Form1.Designer.cs
@@ -30,6 +30,7 @@
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
this.toolStripContainer1 = new System.Windows.Forms.ToolStripContainer();
+ this.fileSizeLabel = new System.Windows.Forms.Label();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@@ -41,7 +42,8 @@
this.toolButton_flipX = new System.Windows.Forms.ToolStripButton();
this.toolButton_flipY = new System.Windows.Forms.ToolStripButton();
this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
- this.fileSizeLabel = new System.Windows.Forms.Label();
+ this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
this.toolStripContainer1.ContentPanel.SuspendLayout();
this.toolStripContainer1.TopToolStripPanel.SuspendLayout();
this.toolStripContainer1.SuspendLayout();
@@ -70,6 +72,14 @@
this.toolStripContainer1.TopToolStripPanel.Controls.Add(this.menuStrip1);
this.toolStripContainer1.TopToolStripPanel.Controls.Add(this.toolStrip1);
//
+ // fileSizeLabel
+ //
+ this.fileSizeLabel.AutoSize = true;
+ this.fileSizeLabel.Location = new System.Drawing.Point(337, 290);
+ this.fileSizeLabel.Name = "fileSizeLabel";
+ this.fileSizeLabel.Size = new System.Drawing.Size(0, 13);
+ this.fileSizeLabel.TabIndex = 1;
+ //
// pictureBox1
//
this.pictureBox1.Dock = System.Windows.Forms.DockStyle.Fill;
@@ -95,6 +105,7 @@
//
this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.openToolStripMenuItem,
+ this.saveToolStripMenuItem,
this.exitToolStripMenuItem});
this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20);
@@ -167,13 +178,12 @@
//
this.openFileDialog1.FileName = "openFileDialog1";
//
- // fileSizeLabel
+ // saveToolStripMenuItem
//
- this.fileSizeLabel.AutoSize = true;
- this.fileSizeLabel.Location = new System.Drawing.Point(337, 290);
- this.fileSizeLabel.Name = "fileSizeLabel";
- this.fileSizeLabel.Size = new System.Drawing.Size(0, 13);
- this.fileSizeLabel.TabIndex = 1;
+ this.saveToolStripMenuItem.Name = "saveToolStripMenuItem";
+ this.saveToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
+ this.saveToolStripMenuItem.Text = "Save";
+ this.saveToolStripMenuItem.Click += new System.EventHandler(this.saveToolStripMenuItem_Click);
//
// Form1
//
@@ -214,6 +224,8 @@
private System.Windows.Forms.ToolStripButton toolButton_flipY;
private System.Windows.Forms.OpenFileDialog openFileDialog1;
private System.Windows.Forms.Label fileSizeLabel;
+ private System.Windows.Forms.ToolStripMenuItem saveToolStripMenuItem;
+ private System.Windows.Forms.SaveFileDialog saveFileDialog1;
}
}
diff --git a/advancedpictureviewer/Form1.cs b/advancedpictureviewer/Form1.cs
index 61ed1ae..5700dd1 100644
--- a/advancedpictureviewer/Form1.cs
+++ b/advancedpictureviewer/Form1.cs
@@ -26,6 +26,21 @@ namespace advancedpictureviewer
pictureBox1.Image = bitmap1;
fileSizeLabel.Text = openFileDialog1.FileName.Length.ToString();
}
+
+ private void saveToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ if ( saveFileDialog1.ShowDialog() == DialogResult.OK )
+ {
+ int width = Convert.ToInt32(pictureBox1.Image.Width);
+ int height = Convert.ToInt32(pictureBox1.Image.Height);
+ using (Bitmap bmp = new Bitmap(width, height))
+ {
+ pictureBox1.DrawToBitmap( bmp, new Rectangle( 0,0, width, height ) );
+ bmp.Save( saveFileDialog1.FileName, System.Drawing.Imaging.ImageFormat.Png );
+ }
+ }
+ }
+
private void exitToolStripMenuItem_Click(object sender, EventArgs e)
{
Application.Exit();
@@ -45,13 +60,13 @@ namespace advancedpictureviewer
private void toolButton_RotY_Click(object sender, EventArgs e)
{
- bitmap1.RotateFlip(RotateFlipType.Rotate270FlipNone);
+ bitmap1.RotateFlip(RotateFlipType.Rotate90FlipNone);
pictureBox1.Image = bitmap1;
}
private void toolButton_RotL_Click(object sender, EventArgs e)
{
- bitmap1.RotateFlip(RotateFlipType.Rotate90FlipNone);
+ bitmap1.RotateFlip(RotateFlipType.Rotate270FlipNone);
pictureBox1.Image = bitmap1;
}
}
diff --git a/advancedpictureviewer/Form1.resx b/advancedpictureviewer/Form1.resx
index c91cec8..b018383 100644
--- a/advancedpictureviewer/Form1.resx
+++ b/advancedpictureviewer/Form1.resx
@@ -187,4 +187,7 @@
237, 17
+
+ 376, 17
+
\ No newline at end of file