views:

635

answers:

1

Ok, I have code that is working (posted after this) but before I expand it I wanted to throw it out here and see maybe better ways of doing what I am doing.

the problem: the SIP panel sucks - sometimes all I need is numbers or letters entered into a mobile application - most of my users wind up not using the stylus but fingers so I need to create big buttons on the screen with each buttn a number or letter that fills in whatever textbox they are currently working on. It also needs to accept input from the devices keyboard at the same time.

My current code:

Top of code:

'setup a object to hold the current input box  
Public currentInputBox As TextBox  

'setup the user for input into a text box  
currentInputBox = LadingOrderQtyTextBox  
ladingOrderQtyTextbox.Focus()


'Routine to handle the numeric screen button '0'  
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click  
    currentInputBox.Text = currentInputBox.Text & "0"  
    'Make sure to move to the end of the text...  
    currentInputBox.SelectionStart = currentInputBox.Text.Length  
    'give focus back  
    currentInputBox.Focus()  
End Sub

This does work, however it requires me to manually keep up with what textbox the user currently is working on...maybe there is no way around this?

Anyway, I am looking forward to the groups thoughts...

Also...is there a better way to post code here?

--Joe End Sub

+2  A: 

The best way to get the right behavior is to create a custom SIP that has the features you want. This would allow whatever "modes" you like, as well as desired button layout, size, etc.

ctacke
I have not chased it down a lot, but the link you use has two drawbacks to this project - one the project is in VB.NET (this requires C++ native code and I have not coded in C++ in many years) and two it adds a lot more complexity to the project than my skill level is currently up to.--Joe
MostlyLucid
Depends on how you look at it. A SIp is pretty straitforward and stand-alone. It's known to work with all Forms and all input items (TextBoxes, Combo's etc). The test matrix and complexity of tracking your individual elements could quickly get out of control, especially for a large or complex UI.IIRC there are some reasonably cheap, configurable SIPs available commercially. Check Handango.
ctacke