Raising an Event

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

    Raising an Event

    I want to have a button that when pressed it reflects the following event:
    // Check if the user presses the action key

    protected override void OnKeyDown(KeyEv entArgs e)
    {
    switch(e.KeyCod e)

    {

    case Keys.Return:

    ............... ..



    So on my windows mobile application when the user presses key 2, it would be
    the same as pressing the return key. How can I do this ?



    Many thanks.


  • Salvador

    #2
    RE: Raising an Event

    Hi,

    What you can do is call the button_Click on your event.

    protected override void OnKeyDown(keyev entsargs e)
    {
    Button_Click(th is, null);
    }


    "Jamie" wrote:
    [color=blue]
    > I want to have a button that when pressed it reflects the following event:
    > // Check if the user presses the action key
    >
    > protected override void OnKeyDown(KeyEv entArgs e)
    > {
    > switch(e.KeyCod e)
    >
    > {
    >
    > case Keys.Return:
    >
    > ............... ..
    >
    >
    >
    > So on my windows mobile application when the user presses key 2, it would be
    > the same as pressing the return key. How can I do this ?
    >
    >
    >
    > Many thanks.
    >
    >
    >[/color]

    Comment

    Working...