RSS

Keyboard on the screen in WinForms

09 Apr

I found this code which work fine without any errors:

 

private void btnScreenkeyboar_Click(object sender, EventArgs e)
{

try
{
StartOSK();
}
catch (Exception error)
{
string err = error.ToString();
}

}

 

static void StartOSK()
{
  string windir = Environment.GetEnvironmentVariable("WINDIR");
  string osk = null;

  if (osk == null)
  {
    osk = Path.Combine(Path.Combine(windir, "sysnative"), "osk.exe");
    if (!File.Exists(osk))
      osk = null;
  }

  if (osk == null)
  {
    osk = Path.Combine(Path.Combine(windir, "system32"), "osk.exe");
    if (!File.Exists(osk))
    {
      osk = null;
    }
  }

  if (osk == null)
    osk = "osk.exe";

  Process.Start(osk);
}


keyboar
Advertisements
 
1 Comment

Posted by on April 9, 2013 in WinForm

 

Tags: , ,

One response to “Keyboard on the screen in WinForms

  1. Asad

    August 29, 2013 at 9:02 pm

    Good

     

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: