2

Is it possible to handle the sip by creating the custom textbox.

I want to create a custom textbox --> create the got focus event--> On focus of my custom textbox instead of SIP my custom keypad should open.

Requirements:

  1. How to create custom textbox?
  2. Open the custom Keypad instead of SIP
  3. Get the cursor in the textfield.
Nate
  • 30,286
  • 23
  • 113
  • 184
rubyraj
  • 611
  • 1
  • 7
  • 24

1 Answers1

1

The display of the SIP is handled by the operating system and will always be on top of the visual tree of any application. If you want to provide a custom SIP, you will need to provide an alternative input control, because the display of the native SIP is tied to input controls (such as TextBox, PasswordBox, etc.). You may find this article about creating a Bulgarian keyboard useful.

To create a custom TextBox you could start by inheriting from TextBox itself, but you may find yourself fighting against the default implementation, so you may just want to inherit from Control instead.

To open the custom SIP instead of the default SIP, you'll need to tie this into an event on your custom TextBox and this is one of the places where inheriting from Control will probably make your life easier, because if you inherit from TextBox, then as soon as it receives focus the default SIP will show. You will probably want to make the SIP part of the ControlTemplate for the PhoneApplicationFrame so that you can guarantee that it is above the page content.

To get a cursor in your custom TextBox you'll need to handle the display of a caret yourself and update it as the user types on your custom SIP.

This is an awful lot of work to achieve something that sounds simple, which I suspect is why noone has done it yet :) I would definitely recommend requesting it as a feature on the official WP7 Dev UserVoice forum

iCollect.it Ltd
  • 92,391
  • 25
  • 181
  • 202
Derek Lakin
  • 16,179
  • 36
  • 51
  • hi lakin, sorry to interrupt u. Do u have some solution for this scenario. I have taken a textbox-> placed a transparent canvas on it->on canvas add a Line object(to show the cursor) -> OnGotFocus of textbox -> transfer the focus on some other control(so SIP Will not be shown>-> Now on text changed event i try to shift the line on canvas so it should be shown as cursor. But Problem is this how could i get the no of pixels occupied by the letter on textchanged in textfield. Is there some work around to get it. – rubyraj Apr 20 '11 at 10:38