-1

Hi I would like to build an app running on Windows 7 using WPF with 2 columns where one column will be a virtual keyboard or on-screen keyboard (osk) and the other column will be the content of my app.

The keyboard will always appear on every page/window of my app. The keyboard is pretty simple, alphabet and numeric with some buttons such as enter and del. My questions are:

  1. How to create 2 columns on a window?
  2. Is there a free to use keyboard to attach it to my project? And how can I create my own virtual keyboard?
  3. How to make the virtual keyboard always appear on every window?
sampathsris
  • 21,564
  • 12
  • 71
  • 98
spondbob
  • 1,523
  • 2
  • 17
  • 34

1 Answers1

0

Building two columns is simple. Add a grid with two ColumnDefinitions like this

<Grid>
    <Grid.ColumnDefinitions>
        <ColumnDefinition Width="Auto" />
        <ColumnDefinition Width="*" />
    </Grid.ColumnDefinitions>
    <Keyboard Grid.Column="0" />
    <CustomContent Grid.Column="1" />
</Grid>

For the keyboard control, you can have a look at this link

Also, If you don't want this fully implemented complex thing, you can simply open up the onscreen keyboard by using this -

public void CheckKeyboard() 
{
    KeyboardCapabilities keyboardCapabilities = new Windows.Devices.Input.KeyboardCapabilities();
    var isKeyboardPresent = keyboardCapabilities.KeyboardPresent != 0 ? true : false;
    if(!isKeyboardPresent)
        ShowKeyboard();
}

public void ShowKeyboard()
{
    Path(Environment.SpecialFolder.System) + Path.DirectorySeparatorChar + "osk.exe");
}
daniele3004
  • 13,072
  • 12
  • 67
  • 75
Mayur Dhingra
  • 1,527
  • 10
  • 27
  • I dont to use windows osk, but thx. And how to make the keyboard always appear on every window? Do I have to paste the keyboard code into the keyboard column? – spondbob Jun 27 '14 at 10:15
  • Please refer to this link - http://www.codeproject.com/Articles/145579/A-Software-Virtual-Keyboard-for-Your-WPF-Apps and go to the section - "Using it for your own application". It explains how can you embed it in your application. – Mayur Dhingra Jun 27 '14 at 10:22
  • that section gives an example on two different windows, my condition is on one window which split in to two cols – spondbob Jun 27 '14 at 11:48
  • Please go through the link, it contains all your answers. – Mayur Dhingra Jun 27 '14 at 13:31