Problem using AddEvent

Discussion in 'Questions (Windows Mobile)' started by EdQas, Sep 9, 2007.

  1. EdQas

    EdQas Member Licensed User

    My program is like that :

    Sub App_Start
    ...
    AddEvent("Lc",Click,"MySub") -> Lc is a textbox
    ...
    End Sub

    Sub MySub
    MyKey=sender
    Select MyKey
    Case "Lc"
    ...
    End Select
    End Sub

    When i run the program and i click in my textbox, the program doesn't go to "MySub"

    Anybody can help me ?

    Thank you !

    EdQas
     
    Last edited: Sep 9, 2007
  2. Erel

    Erel Administrator Staff Member Licensed User

    You can only use events that are supported by the control.
    Try changing it to:
    AddEvent("Lc",GotFocus,"MySub")
     
  3. EdQas

    EdQas Member Licensed User

    AddEvent

    Hello Erel,
    I already tried to use with "GotFocus" and it's the same thing; impossible to the program to enter in "MySub".
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    Try the attached code.
     

    Attached Files:

    • a.sbp
      File size:
      593 bytes
      Views:
      18
  5. EdQas

    EdQas Member Licensed User

    AddEvent

    In fact, Erel, i put a "break" just after Sub MySub. The program enters in "MySub" but having nothing to "break", the program goes on correctly.

    Beginning is difficult, i'm loosing my hair !!! [look to my avatar]

    :sign0144:

    Thank you very much Erel !

    EdQas
     
  6. Erel

    Erel Administrator Staff Member Licensed User

    Lol
     
  7. dennishea

    dennishea Active Member Licensed User

    I not sure if this satisfys what your trying to do but it works.

    Sub Globals
    'Declare the global variables here.
    MyKey = "Lc"
    End Sub

    Sub App_Start
    MySub
    form1.Show
    End Sub

    Sub MySub
    Select MyKey
    Case "Lc"
    Label1.Text = "Hi"
    label1.Visible = true
    End Select
    End Sub

    dennishea
     
  8. EdQas

    EdQas Member Licensed User

    Good idea !
    Thank you.
    Have a nice sunday.
     
Loading...