{"id":890,"date":"2019-06-26T14:49:45","date_gmt":"2019-06-26T13:49:45","guid":{"rendered":"https:\/\/ibex.tech\/windows-iot\/?p=890"},"modified":"2019-06-26T14:49:45","modified_gmt":"2019-06-26T13:49:45","slug":"touchscreen-keyboard","status":"publish","type":"post","link":"https:\/\/ibex.tech\/csharp\/uwp-programming-in-c\/keyboard\/touchscreen-keyboard","title":{"rendered":"Touchscreen Keyboard"},"content":{"rendered":"\n<p>The touchscreen keyboard is provided by the Windows IoT operating system and needs to be enabled.<\/p>\n\n\n\n<p>Open the web interface based \u201cWindows Device Portal\u201d as above and select: Device Settings &gt; On-screen Keyboard &gt; Set the checkbox to ticked<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Make Keyboard appear<\/h4>\n\n\n\n<h5 class=\"wp-block-heading\">Give text box focus<\/h5>\n\n\n\n<pre class=\"wp-block-code\"><code>txtMyTextBox.Focus(FocusState.Programmatic);<\/code><\/pre>\n\n\n\n<h5 class=\"wp-block-heading\">Another method (won&#8217;t always work but can be useful sometimes)<\/h5>\n\n\n\n<pre class=\"wp-block-code\"><code>InputPane.GetForCurrentView().TryShow();<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Using a hidden TextBox<\/h4>\n\n\n\n<p>You can&#8217;t set a text box to not visible and have it still take focus \/ text entry, but you can achieve the same thing by setting its opacity to 0:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>MyTextBox.Opacity = 0;<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Stopping keyboard appearing<\/h4>\n\n\n\n<p>The TextBox class has PreventKeyboardDisplayOnProgrammaticFocus property<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Selecting keyboard type<\/h4>\n\n\n\n<p>Use input scope to select, e.g.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>    &lt;TextBox Header=\"Name\" InputScope=\"Default\"\/&gt;\n    &lt;TextBox Header=\"Email Address\" InputScope=\"EmailSmtpAddress\"\/&gt;\n    &lt;TextBox Header=\"Telephone Number\" InputScope=\"TelephoneNumber\"\/&gt;\n    &lt;TextBox Header=\"Web site\" InputScope=\"Url\"\/&gt;<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>The touchscreen keyboard is provided by the Windows IoT operating system and needs to be enabled. Open the web interface based \u201cWindows Device Portal\u201d as above and select: Device Settings &gt; On-screen Keyboard &gt; Set the checkbox to ticked Make Keyboard appear Give text box focus Another method (won&#8217;t always work but can be useful [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[107,108],"tags":[],"class_list":["post-890","post","type-post","status-publish","format-standard","hentry","category-keyboard","category-touchscreens"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/posts\/890","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/comments?post=890"}],"version-history":[{"count":0,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/posts\/890\/revisions"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/media?parent=890"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/categories?post=890"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/tags?post=890"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}