473,654 Members | 3,098 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

on screen keyboard

Hi, i'm kinda new to vb.net and i'm trying to make an on screen
keyboard to use with a touch screen. how do i get it to print a
letter on the screen when the button is pressed in the textbox that is
selected? do i do it as a ascii character?

i'm trying to get data from a user. there are a couple of different
field the user will have to type information into. (i.e. first name,
last name, .etc)

Mar 29 '07 #1
4 7777
On Mar 29, 11:41 am, jonathandr...@g mail.com wrote:
Hi, i'm kinda new to vb.net and i'm trying to make an on screen
keyboard to use with a touch screen. how do i get it to print a
letter on the screen when the button is pressed in the textbox that is
selected? do i do it as a ascii character?

i'm trying to get data from a user. there are a couple of different
field the user will have to type information into. (i.e. first name,
last name, .etc)
Are you trying to write a global on screen keyboard or just one to use
in your application only?

Thanks,

Seth Rowe

Mar 29 '07 #2
Hello Jonathan,

the easiest thing would be to raise an event which contains a variable
with the keycode or the string. However, when developing such a keyboard
(I once wrote one as an OCX, which can be downloaded from
www.henke-hk.com), please keep in mind that there are different layouts
(e.g. on German keyboards you have to press AltGr (Ctrl+Alt)+Q to get
the "@" sign). Considering that .NET supports Unicode, you might need to
consider Chinese/Japanese keyboards and their input methods as well.

Best regards,

Martin

jo***********@g mail.com wrote:
Hi, i'm kinda new to vb.net and i'm trying to make an on screen
keyboard to use with a touch screen. how do i get it to print a
letter on the screen when the button is pressed in the textbox that is
selected? do i do it as a ascii character?

i'm trying to get data from a user. there are a couple of different
field the user will have to type information into. (i.e. first name,
last name, .etc)
Mar 29 '07 #3
On Mar 29, 12:03 pm, "rowe_newsgroup s" <rowe_em...@yah oo.comwrote:
On Mar 29, 11:41 am, jonathandr...@g mail.com wrote:
Hi, i'm kinda new to vb.net and i'm trying to make an on screen
keyboard to use with a touch screen. how do i get it to print a
letter on the screen when the button is pressed in the textbox that is
selected? do i do it as a ascii character?
i'm trying to get data from a user. there are a couple of different
field the user will have to type information into. (i.e. first name,
last name, .etc)

Are you trying to write a global on screen keyboard or just one to use
in your application only?

Thanks,

Seth Rowe
it's with my application

Mar 30 '07 #4
On Mar 30, 7:24 pm, jonathandr...@g mail.com wrote:
On Mar 29, 12:03 pm, "rowe_newsgroup s" <rowe_em...@yah oo.comwrote:
On Mar 29, 11:41 am, jonathandr...@g mail.com wrote:
Hi, i'm kinda new to vb.net and i'm trying to make an on screen
keyboard to use with a touch screen. how do i get it to print a
letter on the screen when the button is pressed in the textbox that is
selected? do i do it as a ascii character?
i'm trying to get data from a user. there are a couple of different
field the user will have to type information into. (i.e. first name,
last name, .etc)
Are you trying to write a global on screen keyboard or just one to use
in your application only?
Thanks,
Seth Rowe

it's with my application
Then the absolute easiest way would be to create a usercontrol that
will act as the keyboard. Then you just have worry about passing the
pressed key back to the "target" control.

Here's a quick sample I just wrote:

First comes the user control. For it you need to add some labels, one
for each key of the keyboard. I set the label's Textalign to
MiddleCenter and the BorderStyle to single to give it more of a key-
like look, though if this was a profession app, I would do some GDI+
work to make the label look more like a button. The reason you need to
use a label and not a button is that labels don't receive focus when
clicked.

Next, add the following code the user control. Note I changed the
inherits to Panel to prevent the usercontrol from getting focus, so
you'll have to change the inherits in the usercontrol.Des igner.vb file
too.

Public Class Keyboard
Inherits Panel

' Wire up all the Label's click events to this event handler
Private Sub Label_Click(ByV al sender As System.Object, ByVal e As
System.EventArg s)
OnKeyPressed(Ne w KeyPressedEvent Args(DirectCast (sender,
Label).Text))
End Sub

Public Event KeyPressed As KeyPressedEvent Handler

Protected Overridable Sub OnKeyPressed(By Val e As
KeyPressedEvent Args)
RaiseEvent KeyPressed(Me, e)
End Sub

End Class

Public Delegate Sub KeyPressedEvent Handler(ByVal sender As Object,
ByVal e As KeyPressedEvent Args)

Public Class KeyPressedEvent Args
Inherits EventArgs

Public Sub New(ByVal keyPressed As String)
Me.KeyPressed = keyPressed
End Sub

Private _KeyPressed As String
Public Property KeyPressed() As String
Get
Return _KeyPressed
End Get
Private Set(ByVal value As String)
_KeyPressed = value
End Set
End Property

End Class

That should be it for the usercontrol, now we just have to worry about
the "host" form. All you have to do is add the new keyboard
usercontrol to a form and then handle the usercontrol's new KeyPressed
event. Use something like the following:

Private Sub Keyboard1_KeyPr essed(ByVal sender As System.Object,
ByVal e As KeyPressedEvent Args)
' You'll have to change this cast if you want to send text
' to a control type other than a TextBox
Dim tb As TextBox = TryCast(Me.Acti veControl, TextBox)
If Not tb Is Nothing Then
tb.Text &= e.KeyPressed
tb.SelectionSta rt = tb.Text.Length
End If
End Sub

Since neither the usercontrol or it's labels can get the focus, the
event handler will try to cast the active control (the control that
had focus before the user clicked the keyboard usercontrol) into a
textbox and then append the text from the KeyPressed event.

I'm guessing there is a more elegant solution to this, but at this
late at night I can't think of one :-) Anyways, I hope it helps you
out!

Thanks,

Seth Rowe

Mar 31 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
3452
by: gregory_may | last post by:
Is there a way to grab a "Screen Shot" that includes "Tool Tips"? I saw this code someplace, cant remember where. But it doesnt grab "Tool Tips". Is there a better way to do this in .net? Thanks! Private Declare Function CreateDC Lib "gdi32" Alias "CreateDCA" (ByVal lpDriverName As String, ByVal lpDeviceName As String, ByVal lpOutput As String, ByVal lpInitData As String) As Integer
0
7956
by: Hiroyuki Tanaka | last post by:
Hi, I am trying to develop an application for a touch screen using buttons for the numeric pad with Completion ComboBoxes. At the moment I am having a problem sending the button presses to my Completion ComboBox using sendkey.wait. From the keyboard (that will not exist for my final application) I can enter text into my Completion and the selection completes as expected.
0
2660
by: Hiroyuki Tanaka | last post by:
Hi All, I am trying to develop an application for a touch screen using buttons for the numeric pad with Completion ComboBoxes. At the moment I am having a problem sending the button presses to my Completion ComboBox using sendkey.wait. From the keyboard (that will not exist for my final application) I can enter text into my Completion and the selection completes as expected.
2
15758
by: Simon Verona | last post by:
I know that Windows has a "clickable" keyboard that can pop up when necessary.. I have a touch-screen based application. Is there anyway that I can utilise this keyboard application in windows to automatically fill the current textbox if a button is pushed to display the keyboard?????? Or do I have to write my own popup keyboard? Thanks in advance Simon
4
2644
by: =?Utf-8?B?SmltIE9ybXNiZWU=?= | last post by:
Hopefully my solution will help others. I have a MacBook Pro on which I am running WindowsXP Home Edition. It is running totally separate from the Mac OS. I have to reboot to switch between OS's. After running my system for about 3 months successfully with a combination Microsoft wireless mouse & keyboard, I developed the common screen saver will not start problem. I tried everything in the community newsgroups I could find with no success....
4
3881
by: Dennieku | last post by:
Hi, I have to develop an on-screen keyboard and on-screen numeric keypad for a touchscreen UI. The hardest thing with this is that it has to be multi-lingual. Has anybody have ideas how to handle the strange characters of some languages and how to handle the different number of characters in the alphabet of some languages? I've already started with the numeric keypad and I've changed the culture to
0
1381
by: =?Utf-8?B?S2VpdGggVw==?= | last post by:
My sons computer is password protected and his Logitech wireless keyboard does not work @ the windows logon screen. The mouse works but that is it. I plugged in a ps2 keyboard and it works when i'm in the bios but not on the login screen. I can't get into safe mode due to the password protection. Is it posibly software corruption?
3
4503
by: Scotter | last post by:
Hi everyone, I was wondering if anyone knows a way that i can get the on screen keyboard in windows xp pro to show up on login. I have a touch screen monitor, and I still want the usual login process, but without an actual keyboard, im not sure how i can accomplish this. Thanks, Scotter
5
3427
by: bdy120602 | last post by:
Is it possible, when a user or viewer of your Web page, prints or takes a screen shot of a Web page with mousover (roll-over) text in it, to have that text printed or captures as part of the screen shot? If so, how? Thanks,
0
8375
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
8482
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8593
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7306
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5622
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4149
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4294
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2714
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1593
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.