locked
create SMS composer UI for PocketPC and Smartphone RRS feed

  • Question

  • How do I create a UI similar to the native SMS composer UI? I am referring to the 2 multiline textboxes used in the recipient list and the SMS text. These textboxes do not have their own scrollbar; rather they expand in size as the text grows larger, and the form's vertical scrollbar will appear when the total height exceeds the form's height. I can use a .NET textbox control and make it look similiar by changing the BackColor property to White, hiding its scrollbar and then write code to change the textbox height appropriately when the text changes so as to hide its scrollbar. This works fine as long as the form's vertical scrollbar doesn't appear. Once the scrollbar appears and the user scrolls up and down, the textboxes will not redraw properly, causing UI distortion.

    Smartphones are out of the question too. Textboxes on smartphone do not allow inline editing. Once the user presses ENTER on the textbox, a new window named "Edit Text" will open and text editing must be done inside that window!

    Any suggestion on how to improve this? Is there a sample code somewhere that I can use? Thanks.
    Wednesday, March 4, 2009 3:15 AM

Answers

  • The implementation doesn't use standard controls, it's actually based on a html template and hosted in a html editing control. There isn't a control available out of the box to do this in .NETCF so you either write a custom control and handle the drawing and text measuring yourself, or have to simplify to fit whats available.

    Device Application Development MVP. APPA Mundi Ltd - software solutions for a mobile world. In The Hand Ltd - .NET Components for Mobility
    • Marked as answer by warrentang Tuesday, March 10, 2009 2:07 AM
    Wednesday, March 4, 2009 7:45 PM

All replies

  • The implementation doesn't use standard controls, it's actually based on a html template and hosted in a html editing control. There isn't a control available out of the box to do this in .NETCF so you either write a custom control and handle the drawing and text measuring yourself, or have to simplify to fit whats available.

    Device Application Development MVP. APPA Mundi Ltd - software solutions for a mobile world. In The Hand Ltd - .NET Components for Mobility
    • Marked as answer by warrentang Tuesday, March 10, 2009 2:07 AM
    Wednesday, March 4, 2009 7:45 PM
  • You meant the UI was defined using a HTML template and then fed into something like a WebBrowser control to render? I have tried it but the resulting UI doesn't look the same, although I have applied fancy HTML tags and CSS. Not to mention I don't know how to retrieve the data the user has entered if the textboxes are part of an HTML form lying inside a WebBrowser control!

    Where can I find more about the HTML editing control you mentioned? Thanks.
    Thursday, March 5, 2009 4:11 AM
  • Hi, 

    You can use the MessagingApplication.DisplayComposeForm method (Windows Mobile 5 or later) to display a composer form for an SMS:
    http://msdn.microsoft.com/en-us/library/microsoft.windowsmobile.pocketoutlook.messagingapplication.displaycomposeform.aspx

    Here is a short demo:
            private void button1_Click(object sender, EventArgs e)
            {
                SmsMessage sms = new SmsMessage("12345678", "Greetings");                           
                Microsoft.WindowsMobile.PocketOutlook.MessagingApplication.DisplayComposeForm(sms);
            }

    Regards,
    Chunsheng Tang
    Please mark the post that helps you, and unmark that does not. This benefits our community members.
    Monday, March 9, 2009 2:09 AM
  • Thanks for your reply, but I do not want to launch the built-in composer. I want to build my *own* composer which looks like the built-in composer.
    Monday, March 9, 2009 2:54 AM
  • Then you would follow Peter's suggestions.
    Monday, March 9, 2009 3:45 AM