├── KeyPad ├── KeyPad │ ├── app.config │ ├── Properties │ │ ├── Settings.settings │ │ ├── Settings.Designer.cs │ │ ├── AssemblyInfo.cs │ │ ├── Resources.Designer.cs │ │ └── Resources.resx │ ├── Converter │ │ └── BoolToVisibilityConverter.cs │ ├── Keypad.xaml │ ├── Keypad.xaml.cs │ ├── KeyPad.csproj │ ├── VirtualKeyboard.xaml.cs │ └── VirtualKeyboard.xaml ├── KeyPad.suo ├── KeyPad.sln.docstates.suo ├── TestKeypad │ ├── Properties │ │ ├── Settings.settings │ │ ├── Settings.Designer.cs │ │ ├── AssemblyInfo.cs │ │ ├── Resources.Designer.cs │ │ └── Resources.resx │ ├── App.xaml │ ├── App.xaml.cs │ ├── MainWindow.xaml │ ├── MainWindow.xaml.cs │ └── TestKeypad.csproj └── KeyPad.sln ├── .gitignore └── README.md /KeyPad/KeyPad/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /KeyPad/KeyPad.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mesta1/WPF-on-screen-keyboard-and-keypad/HEAD/KeyPad/KeyPad.suo -------------------------------------------------------------------------------- /KeyPad/KeyPad.sln.docstates.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mesta1/WPF-on-screen-keyboard-and-keypad/HEAD/KeyPad/KeyPad.sln.docstates.suo -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Build Folders (you can keep bin if you'd like, to store dlls and pdbs) 2 | bin 3 | obj 4 | 5 | # mstest test results 6 | TestResults -------------------------------------------------------------------------------- /KeyPad/KeyPad/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /KeyPad/TestKeypad/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | WPF-on-screen-keyboard-and-keypad 2 | ================================= 3 | 4 | Contains a WPF keypad and keyboard that can be used with touch applications and that has a good graphic 5 | Read the full article at http://www.mesta-automation.com/wpf-touch-keyboard/ 6 | -------------------------------------------------------------------------------- /KeyPad/TestKeypad/App.xaml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /KeyPad/TestKeypad/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Configuration; 4 | using System.Data; 5 | using System.Linq; 6 | using System.Windows; 7 | 8 | namespace TestKeypad 9 | { 10 | /// 11 | /// Logica di interazione per App.xaml 12 | /// 13 | public partial class App : Application 14 | { 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /KeyPad/KeyPad/Converter/BoolToVisibilityConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Windows.Data; 6 | 7 | namespace KeyPad.Converter 8 | { 9 | class BoolToVisibilityConverter : IValueConverter 10 | { 11 | public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) 12 | { 13 | if ((bool?)value == true) 14 | return System.Windows.Visibility.Visible; 15 | else 16 | return System.Windows.Visibility.Collapsed; 17 | } 18 | 19 | public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) 20 | { 21 | throw new NotImplementedException(); 22 | } 23 | } 24 | 25 | } 26 | 27 | 28 | -------------------------------------------------------------------------------- /KeyPad/TestKeypad/MainWindow.xaml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 13 | 14 | -------------------------------------------------------------------------------- /KeyPad/KeyPad/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.239 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace KeyPad.Properties 12 | { 13 | 14 | 15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] 17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase 18 | { 19 | 20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 21 | 22 | public static Settings Default 23 | { 24 | get 25 | { 26 | return defaultInstance; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /KeyPad/TestKeypad/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.239 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace TestKeypad.Properties 12 | { 13 | 14 | 15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] 17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase 18 | { 19 | 20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 21 | 22 | public static Settings Default 23 | { 24 | get 25 | { 26 | return defaultInstance; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /KeyPad/KeyPad.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KeyPad", "KeyPad\KeyPad.csproj", "{3ADBFF38-915C-4115-9CDD-81C0CAD9733A}" 5 | EndProject 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestKeypad", "TestKeypad\TestKeypad.csproj", "{2302659E-071F-4525-9D8F-C16AE000B201}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x86 = Debug|x86 11 | Release|x86 = Release|x86 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {3ADBFF38-915C-4115-9CDD-81C0CAD9733A}.Debug|x86.ActiveCfg = Debug|x86 15 | {3ADBFF38-915C-4115-9CDD-81C0CAD9733A}.Debug|x86.Build.0 = Debug|x86 16 | {3ADBFF38-915C-4115-9CDD-81C0CAD9733A}.Release|x86.ActiveCfg = Release|x86 17 | {3ADBFF38-915C-4115-9CDD-81C0CAD9733A}.Release|x86.Build.0 = Release|x86 18 | {2302659E-071F-4525-9D8F-C16AE000B201}.Debug|x86.ActiveCfg = Debug|x86 19 | {2302659E-071F-4525-9D8F-C16AE000B201}.Debug|x86.Build.0 = Debug|x86 20 | {2302659E-071F-4525-9D8F-C16AE000B201}.Release|x86.ActiveCfg = Release|x86 21 | {2302659E-071F-4525-9D8F-C16AE000B201}.Release|x86.Build.0 = Release|x86 22 | EndGlobalSection 23 | GlobalSection(SolutionProperties) = preSolution 24 | HideSolutionNode = FALSE 25 | EndGlobalSection 26 | EndGlobal 27 | -------------------------------------------------------------------------------- /KeyPad/TestKeypad/MainWindow.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Windows; 6 | using System.Windows.Controls; 7 | using System.Windows.Data; 8 | using System.Windows.Documents; 9 | using System.Windows.Input; 10 | using System.Windows.Media; 11 | using System.Windows.Media.Imaging; 12 | using System.Windows.Navigation; 13 | using System.Windows.Shapes; 14 | using KeyPad; 15 | 16 | namespace TestKeypad 17 | { 18 | /// 19 | /// Logica di interazione per MainWindow.xaml 20 | /// 21 | public partial class MainWindow : Window 22 | { 23 | public MainWindow() 24 | { 25 | InitializeComponent(); 26 | } 27 | 28 | private void textBox1_PreviewMouseDown(object sender, MouseButtonEventArgs e) 29 | { 30 | TextBox textbox = sender as TextBox; 31 | Keypad keypadWindow = new Keypad(textbox, this); 32 | if (keypadWindow.ShowDialog() == true) 33 | textbox.Text = keypadWindow.Result; 34 | } 35 | 36 | private void textBox2_PreviewMouseDown(object sender, MouseButtonEventArgs e) 37 | { 38 | TextBox textbox = sender as TextBox; 39 | VirtualKeyboard keyboardWindow = new VirtualKeyboard(textbox, this); 40 | if (keyboardWindow.ShowDialog() == true) 41 | textbox.Text = keyboardWindow.Result; 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /KeyPad/KeyPad/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Resources; 3 | using System.Runtime.CompilerServices; 4 | using System.Runtime.InteropServices; 5 | using System.Windows; 6 | 7 | // Le informazioni generali relative a un assembly sono controllate dal seguente 8 | // set di attributi. Per modificare le informazioni associate a un assembly 9 | // occorre quindi modificare i valori di questi attributi. 10 | [assembly: AssemblyTitle("KeyPad")] 11 | [assembly: AssemblyDescription("")] 12 | [assembly: AssemblyConfiguration("")] 13 | [assembly: AssemblyCompany("")] 14 | [assembly: AssemblyProduct("KeyPad")] 15 | [assembly: AssemblyCopyright("Copyright © 2012")] 16 | [assembly: AssemblyTrademark("")] 17 | [assembly: AssemblyCulture("")] 18 | 19 | // Se si imposta ComVisible su false, i tipi in questo assembly non saranno visibili 20 | // ai componenti COM. Se è necessario accedere a un tipo in questo assembly da 21 | // COM, impostare su true l'attributo ComVisible per tale tipo. 22 | [assembly: ComVisible(false)] 23 | 24 | //Per iniziare la compilazione delle applicazioni localizzabili, impostare 25 | //CultureYouAreCodingWith nel file .csproj 26 | //all'interno di un . Ad esempio, se si utilizza l'inglese (Stati Uniti) 27 | //nei file di origine, impostare su en-US. Rimuovere quindi il commento dall'attributo 28 | //NeutralResourceLanguage riportato di seguito. Aggiornare "en-US" nella 29 | //riga sottostante in modo che corrisponda all'impostazione UICulture nel file di progetto. 30 | 31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] 32 | 33 | 34 | [assembly: ThemeInfo( 35 | ResourceDictionaryLocation.None, //dove si trovano i dizionari delle risorse specifiche del tema 36 | //(in uso se non è possibile trovare una risorsa nella pagina 37 | // oppure nei dizionari delle risorse dell'applicazione) 38 | ResourceDictionaryLocation.SourceAssembly //dove si trova il dizionario delle risorse generiche 39 | //(in uso se non è possibile trovare una risorsa nella pagina, 40 | // nell'applicazione o nei dizionari delle risorse specifiche del tema) 41 | )] 42 | 43 | 44 | // Le informazioni sulla versione di un assembly sono costituite dai seguenti quattro valori: 45 | // 46 | // Numero di versione principale 47 | // Numero di versione secondario 48 | // Numero build 49 | // Revisione 50 | // 51 | // È possibile specificare tutti i valori oppure impostare valori predefiniti per i numeri relativi alla revisione e alla build 52 | // utilizzando l'asterisco (*) come descritto di seguito: 53 | // [assembly: AssemblyVersion("1.0.*")] 54 | [assembly: AssemblyVersion("1.0.0.0")] 55 | [assembly: AssemblyFileVersion("1.0.0.0")] 56 | -------------------------------------------------------------------------------- /KeyPad/TestKeypad/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Resources; 3 | using System.Runtime.CompilerServices; 4 | using System.Runtime.InteropServices; 5 | using System.Windows; 6 | 7 | // Le informazioni generali relative a un assembly sono controllate dal seguente 8 | // set di attributi. Per modificare le informazioni associate a un assembly 9 | // occorre quindi modificare i valori di questi attributi. 10 | [assembly: AssemblyTitle("TestKeypad")] 11 | [assembly: AssemblyDescription("")] 12 | [assembly: AssemblyConfiguration("")] 13 | [assembly: AssemblyCompany("")] 14 | [assembly: AssemblyProduct("TestKeypad")] 15 | [assembly: AssemblyCopyright("Copyright © 2012")] 16 | [assembly: AssemblyTrademark("")] 17 | [assembly: AssemblyCulture("")] 18 | 19 | // Se si imposta ComVisible su false, i tipi in questo assembly non saranno visibili 20 | // ai componenti COM. Se è necessario accedere a un tipo in questo assembly da 21 | // COM, impostare su true l'attributo ComVisible per tale tipo. 22 | [assembly: ComVisible(false)] 23 | 24 | //Per iniziare la compilazione delle applicazioni localizzabili, impostare 25 | //CultureYouAreCodingWith nel file .csproj 26 | //all'interno di un . Ad esempio, se si utilizza l'inglese (Stati Uniti) 27 | //nei file di origine, impostare su en-US. Rimuovere quindi il commento dall'attributo 28 | //NeutralResourceLanguage riportato di seguito. Aggiornare "en-US" nella 29 | //riga sottostante in modo che corrisponda all'impostazione UICulture nel file di progetto. 30 | 31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] 32 | 33 | 34 | [assembly: ThemeInfo( 35 | ResourceDictionaryLocation.None, //dove si trovano i dizionari delle risorse specifiche del tema 36 | //(in uso se non è possibile trovare una risorsa nella pagina 37 | // oppure nei dizionari delle risorse dell'applicazione) 38 | ResourceDictionaryLocation.SourceAssembly //dove si trova il dizionario delle risorse generiche 39 | //(in uso se non è possibile trovare una risorsa nella pagina, 40 | // nell'applicazione o nei dizionari delle risorse specifiche del tema) 41 | )] 42 | 43 | 44 | // Le informazioni sulla versione di un assembly sono costituite dai seguenti quattro valori: 45 | // 46 | // Numero di versione principale 47 | // Numero di versione secondario 48 | // Numero build 49 | // Revisione 50 | // 51 | // È possibile specificare tutti i valori oppure impostare valori predefiniti per i numeri relativi alla revisione e alla build 52 | // utilizzando l'asterisco (*) come descritto di seguito: 53 | // [assembly: AssemblyVersion("1.0.*")] 54 | [assembly: AssemblyVersion("1.0.0.0")] 55 | [assembly: AssemblyFileVersion("1.0.0.0")] 56 | -------------------------------------------------------------------------------- /KeyPad/KeyPad/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // Codice generato da uno strumento. 4 | // Versione runtime:4.0.30319.239 5 | // 6 | // Le modifiche a questo file possono causare un comportamento non corretto e verranno perse 7 | // se il codice viene rigenerato. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace KeyPad.Properties 12 | { 13 | 14 | 15 | /// 16 | /// Classe di risorse fortemente tipizzata per la ricerca di stringhe localizzate e così via. 17 | /// 18 | // Questa classe è stata generata automaticamente dalla classe StronglyTypedResourceBuilder 19 | // tramite uno strumento quale ResGen o Visual Studio. 20 | // Per aggiungere o rimuovere un membro, modificare il file con estensione .ResX, quindi eseguire di nuovo ResGen 21 | // con l'opzione /str oppure ricompilare il progetto VS. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources 26 | { 27 | 28 | private static global::System.Resources.ResourceManager resourceMan; 29 | 30 | private static global::System.Globalization.CultureInfo resourceCulture; 31 | 32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 33 | internal Resources() 34 | { 35 | } 36 | 37 | /// 38 | /// Restituisce l'istanza di ResourceManager nella cache utilizzata da questa classe. 39 | /// 40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 41 | internal static global::System.Resources.ResourceManager ResourceManager 42 | { 43 | get 44 | { 45 | if ((resourceMan == null)) 46 | { 47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("KeyPad.Properties.Resources", typeof(Resources).Assembly); 48 | resourceMan = temp; 49 | } 50 | return resourceMan; 51 | } 52 | } 53 | 54 | /// 55 | /// Esegue l'override della proprietà CurrentUICulture del thread corrente per tutte 56 | /// le ricerche di risorse che utilizzano questa classe di risorse fortemente tipizzata. 57 | /// 58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 59 | internal static global::System.Globalization.CultureInfo Culture 60 | { 61 | get 62 | { 63 | return resourceCulture; 64 | } 65 | set 66 | { 67 | resourceCulture = value; 68 | } 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /KeyPad/TestKeypad/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // Codice generato da uno strumento. 4 | // Versione runtime:4.0.30319.239 5 | // 6 | // Le modifiche a questo file possono causare un comportamento non corretto e verranno perse 7 | // se il codice viene rigenerato. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace TestKeypad.Properties 12 | { 13 | 14 | 15 | /// 16 | /// Classe di risorse fortemente tipizzata per la ricerca di stringhe localizzate e così via. 17 | /// 18 | // Questa classe è stata generata automaticamente dalla classe StronglyTypedResourceBuilder 19 | // tramite uno strumento quale ResGen o Visual Studio. 20 | // Per aggiungere o rimuovere un membro, modificare il file con estensione .ResX, quindi eseguire di nuovo ResGen 21 | // con l'opzione /str oppure ricompilare il progetto VS. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources 26 | { 27 | 28 | private static global::System.Resources.ResourceManager resourceMan; 29 | 30 | private static global::System.Globalization.CultureInfo resourceCulture; 31 | 32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 33 | internal Resources() 34 | { 35 | } 36 | 37 | /// 38 | /// Restituisce l'istanza di ResourceManager nella cache utilizzata da questa classe. 39 | /// 40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 41 | internal static global::System.Resources.ResourceManager ResourceManager 42 | { 43 | get 44 | { 45 | if ((resourceMan == null)) 46 | { 47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("TestKeypad.Properties.Resources", typeof(Resources).Assembly); 48 | resourceMan = temp; 49 | } 50 | return resourceMan; 51 | } 52 | } 53 | 54 | /// 55 | /// Esegue l'override della proprietà CurrentUICulture del thread corrente per tutte 56 | /// le ricerche di risorse che utilizzano questa classe di risorse fortemente tipizzata. 57 | /// 58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 59 | internal static global::System.Globalization.CultureInfo Culture 60 | { 61 | get 62 | { 63 | return resourceCulture; 64 | } 65 | set 66 | { 67 | resourceCulture = value; 68 | } 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /KeyPad/KeyPad/Keypad.xaml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 11 | 12 | 13 | 14 | 15 | 16 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 50 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 161 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 264 | 265 | 266 | 267 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 313 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 338 | 339 | 340 | 341 |