Bug ??

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Gary

    #1

    Bug ??

    Hi,

    I am trying to use the "System.Windows .Forms.SendKeys " class for triggering
    the Ctrl+P key.

    Syntax:
    System.Windows. Forms.SendKeys. Send("^(P)")

    This is not working ..what could be the reason..?

    Situation:
    I have a menu in my form, which is given a short key "Ctrl+P", now when the
    form gets loaded, when I press the "Ctrl+P" then the menu functionality is
    working. But the same thing I wanted to trigger on a button on click with
    the following code..

    System.Windows. Forms.SendKeys. Send("^(P)")

    this is not working..

    Note: Infact any of the "Ctr+AnyAlphabe t", ie, Ctrl+A or..Ctrl+B..or
    ...C..like that is not working when using
    System.Windows. Forms.SendKeys. Send("^(P)")
    But the same thing is working fine, when I have as "Ctrl+AnyNumber ", ie,
    Ctrl+1 or Ctrl+2 with
    System.Windows. Forms.SendKeys. Send("^(1)")

    Please help!
    - Gary



  • Gary

    #2
    Re: Bug ??

    Hi again,

    I got the answer, the call is case-sensetive and hence the following
    statements would work:
    System.Windows. Forms.SendKeys. Send("^(p)")

    - Gary -

    "Gary" <msnews@microso ft.com> wrote in message
    news:OkeS72DeDH A.1888@TK2MSFTN GP12.phx.gbl...[color=blue]
    > Hi,
    >
    > I am trying to use the "System.Windows .Forms.SendKeys " class for[/color]
    triggering[color=blue]
    > the Ctrl+P key.
    >
    > Syntax:
    > System.Windows. Forms.SendKeys. Send("^(P)")
    >
    > This is not working ..what could be the reason..?
    >
    > Situation:
    > I have a menu in my form, which is given a short key "Ctrl+P", now when[/color]
    the[color=blue]
    > form gets loaded, when I press the "Ctrl+P" then the menu functionality is
    > working. But the same thing I wanted to trigger on a button on click with
    > the following code..
    >
    > System.Windows. Forms.SendKeys. Send("^(P)")
    >
    > this is not working..
    >
    > Note: Infact any of the "Ctr+AnyAlphabe t", ie, Ctrl+A or..Ctrl+B..or
    > ..C..like that is not working when using
    > System.Windows. Forms.SendKeys. Send("^(P)")
    > But the same thing is working fine, when I have as "Ctrl+AnyNumber ", ie,
    > Ctrl+1 or Ctrl+2 with
    > System.Windows. Forms.SendKeys. Send("^(1)")
    >
    > Please help!
    > - Gary
    >
    >
    >[/color]


    Comment

    Working...