Jump to: navigation, search

How to enable resizing while activating VKB in eRCP

Revision as of 02:19, 11 August 2008 by Johnhsu.tw.ibm.com (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

You need to do three things in order to enable resizing while activating vitual keyboard in eRCP:

1. You need anoher shell under your top level shell because the top level shell can't be resized.

2. You need to set layout for the second shell so that the shell doesn't expand out of the screen.

3. This is the most tricky one, The eRCP does not handle virtual keyboard resizing. It is done by windows mobile itself. However, here is a trick to make it automatically resized when virtual keyboard is activated. You just need to make your widget 1 pixel smaller than the top level shell like this:

   public static void adjustSize() {
       Rectangle rect = shell.getBounds();
       shell2.setBounds(rect.x + 1, rect.y + 1, rect.width - 1, rect.height -1);

you need to use setBounds, notsetSize, and on the second shell instead of the top level shell.