Re: How to scroll to text box when keyboard is displayed

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Paul G. Tobey [eMVP] wrote:
Wait, you want to tab to the next text box or move the text in a given text box? Windows on Windows CE work basically just like they do on the desktop (Tab to the next one, use the Down arrow to scroll).

When the input panel is enabled and there is a textbox that has focus hidden behind the input panel, I have to manually scroll to that textbox to enter data.

In my quest to make user input as efficient as possible, I want code that detects when a textbox is obscured by the input panel. When detected I want the textbox to show its ugly head automatically, without manually scrolling to it.

Just saves a step but when a user does it a hundred times per day or more it is time that adds up.

Thanks

TMA




Paul T.

"The Mad Ape" <chiefape@xxxxxxxxx> wrote in message news:a1dc0c28-6280-4852-aad8-8f1649d69aae@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Aug 27, 12:28 pm, The Mad Ape <chief...@xxxxxxxxx> wrote:
I have code in the GotFocus event that will display the virtual
keyboard when the focused object is a textbox. Not a problem, works
like a charm.

However if the next box is obscured by the keyboard I can not get the
autoscroll to work.

Here is the code to scroll to the textbox:

Private Sub txt1_LostFocus (ByVal sender As Objectm ByVal e As
System.EventArgs) Handles txt1.LostFocus

'This section just closes the Keyboard upon losing focus to this text
box. It works fine
If not InputPanel1 is Nothing Then
If InputPanel1.Enabled = True Then
InputPanel1.Enabled = False
End If
End If

'This does not work
If txt2.Visible = True Then
txt2.Focus()
txt2.ScrollToCaret()
End If

Also For your info I have this code in the GotFocus for txt2
If not InputPanel1 is Nothing Then
If InputPanel1.Enabled = False Then
InputPanel1.Enabled = True
End If
End If

Any ideas? There are other objects above these textboxes so by the
time the use gets to them, they have to enter data, scroll down to the
next one and enter data. It does set the focus on txt2 but it does not
scroll to it.

How can I fix this?

Thanks

TMA

I should also point out that the textboxes exist in a tab in Form 2.
I have used the EnabledChanged feature of the InputPanel to adjust
form size and scrolling.



Private Sub InputPanel1_EnabledChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
InputPanel1.EnabledChanged
If InputPanel1.Enabled = False Then
For Each tbPge In tabCruise.TabPages
tbPge.AutoScroll = False
Next

tabCruise.Height = 267
tabCruise.Width = 240
Else
' The SIP is enabled, so the height of the tab control
' is set to the height of the visible desktop area.
For Each tbPge In tabCruise.TabPages
tbPge.AutoScroll = True
tbPge.AutoScrollMargin = New Size(5, 5)
Next

tabCruise.Height = InputPanel1.VisibleDesktop.Height
tabCruise.Width = InputPanel1.VisibleDesktop.Width
End If
End Sub


.



Relevant Pages

  • Re: How to scroll to text box when keyboard is displayed
    ... control is in the right place. ... the input panel ... desktop (Tab to the next one, use the Down arrow to scroll). ... When the input panel is enabled and there is a textbox that has focus ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: How to scroll to text box when keyboard is displayed
    ... you want to tab to the next text box or move the text in a given text ... Windows on Windows CE work basically just like they do on the desktop ... use the Down arrow to scroll). ... keyboard when the focused object is a textbox. ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: define maxmimum number of characters in mshflexgrid cell
    ... Have been trying to solve the scroll -isue, ... the textbox should move always when the gridrow moves, ...  But in anycase, this is the modification I made ot get your scroll ... Public Sub MouseWheel(formulier As Form, ByVal MouseKeys As Long, ByVal ...
    (microsoft.public.vb.general.discussion)
  • Re: Textbox wont scroll
    ... I have placed a TextBox control on a form, and would like to add text ... Private Sub AddText ... The problem is that it does not scroll the text upward. ...
    (microsoft.public.vb.general.discussion)
  • Re: Searching a textbox
    ... page of data when I hit the vertical scroll on the textbox), ... How can I automatically scroll to the 2nd page of the multiline text box? ... Seperate textboxes, RichTextBox or other control? ...
    (microsoft.public.dotnet.languages.vb)