Home > Support > Forum

Simulating Android/iPhone/WM7

Posted by vpalhories 
Simulating Android/iPhone/WM7
September 08, 2011 02:54PM
Hello,

I'm trying to incorporate the keyboard into my test application to behave like an Android/iPhone/WM7. That is, when the keyboard is displayed, move everything up. I'm having some trouble with this and was hoping someone could help. I'm using "docking" to achieve what I'm looking for. It works, but it's just not "sexy" enough. I was hoping someone might have done this already and they could share their code. Here's what I have so far:

 private void showKeyboard(ref BeeMobile.RoundTextBox.RoundTextBox InputControl, ref BeeMobile.TransparentControls.TLabel InputControlLabel)
        {
            if (keyboardControl1.Visible == true)
            {
                hidekeyboard(ref InputControl, ref InputControlLabel);
            }
            else
            {
                ctrlOriginalPos = InputControl.Location;
                ctrlOriginalSize = InputControl.Size;

                lblOriginalPos = InputControlLabel.Location;
                lblOriginalSize = InputControlLabel.Size;

                keyboardControl1.Dock = DockStyle.Bottom;
                keyboardControl1.Height = 314;
                keyboardControl1.Width = 480;

                pnlMenu.Visible = false;

                keyboardControl1.Visible = true;
                keyboardControl1.BringToFront();

                InputControl.Dock = DockStyle.Bottom;
                InputControl.BringToFront();

                InputControlLabel.Dock = DockStyle.Bottom;
                InputControlLabel.BringToFront();
            }
        }

 private void hidekeyboard(ref BeeMobile.RoundTextBox.RoundTextBox InputControl, ref BeeMobile.TransparentControls.TLabel InputControlLabel)
        {
            keyboardControl1.Visible = false;

            InputControl.Dock = DockStyle.None;
            InputControl.Location = ctrlOriginalPos;
            InputControl.Size = ctrlOriginalSize;

            InputControlLabel.Dock = DockStyle.None;
            InputControlLabel.Location = lblOriginalPos;
            InputControlLabel.Size = lblOriginalSize;

Any help would really be appreciated.

Thanks.

-- Val
Re: Simulating Android/iPhone/WM7
September 09, 2011 04:29AM
Hi Val,

by "not sexy enough" you probably mean the overlapping of controls.

Just an idea: I would try to move every controls to a Panel except the Keyboard control. Then when I show the keyboard I would set its Dock property to Bottom, and then you can move the Panel up to view the focused RoundTextBox control. Also don't forget to turn off the AutoScroll property of your Form.

Hope it helps!

Best regards,
Gabriel
the BeeMobile team
Re: Simulating Android/iPhone/WM7
September 29, 2011 02:48PM
Thanks Gabriel. Yes, that did help.

--- Val
Sorry, only registered users may post in this forum.

Click here to login