"AddEvent" and "buttonUp/buttonDown"

Discussion in 'Questions (Windows Mobile)' started by Byak@, Sep 10, 2008.

  1. Byak@

    Byak@ Active Member Licensed User

    if i'm use
    Code:
    addevent("button1",click,"b_click")
    it work fine.but if i'm use
    Code:
    addevent("imagebutton1",buttonup,"b_click")
    it's not work.why?:confused:
     
  2. Cableguy

    Cableguy Expert Licensed User

    The b4p imagebutton does NOT support buttonup or buttondown, only the click event..
    To Trap those events, you must use the door lib, and add the event from it...
     
  3. Byak@

    Byak@ Active Member Licensed User

    stop!you not right!imagebutton support buttonup and buttondown!when i creat this event from IDE it's work fine.
     
  4. Cableguy

    Cableguy Expert Licensed User

    Open the IDE in the form designer, add an image button, select it and choose EVENTS... only the click event is visible FROM WITHIN basic4ppc...
     
  5. Byak@

    Byak@ Active Member Licensed User

    and what about it?[​IMG]
     
  6. Cableguy

    Cableguy Expert Licensed User

    Ok, Sorry!!!
    I'm at work and I only have the 5.5 version of the IDE, in my work PC, but remeber that the events name are case sensitive...
    So you should try "ButtonUp" and "ButtonDown"....
     
  7. Byak@

    Byak@ Active Member Licensed User

    nothing to sorry,all ok =)

    i'm try some variants and what i'm see:
    when i'm use
    Code:
    sub app_start
    form1.show
    addevent(
    "imagebutton1",ButtonDown,"b1")
    end sub

    sub b1
    msgbox(1)
    end sub
    it's not work BUT when i'm use
    Code:
    sub app_start
    form1.show
    addevent(
    "imagebutton1",ButtonDown,"b1")
    end sub

    sub b1
    msgbox(1)
    end sub

    sub imagebutton1_ButtonDown

    end sub
    it's work!!!
    but it's not good,my programm contain ~30 buttons
    how can i add event without creating it with IDE
     
  8. agraham

    agraham Expert Licensed User

    Actually the event names are not case-sensitive in B4ppc. It is only when using the Door library that things become case-sensitive. This seems to be an IDE bug. Both legacy and compiled apps add the event OK (in version 6.42 at least), the IDE doesn't.
     
  9. Byak@

    Byak@ Active Member Licensed User

    agraham please help me!how add 1 event for many imagebuttons?
    event "buttondown".i'm use b4p 6.30
     
  10. agraham

    agraham Expert Licensed User

    Various ways. If they are labelled sequentially then something like this.
    Code:
    Sub App_Start
      Form1.Show
      
    For i = 1 To 30
        AddEvent(
    "ImageButton" & i, click, "Down")
      
    Next      
    End Sub

    Sub Down
      
    Msgbox(Sender)
    End Sub
     
  11. Byak@

    Byak@ Active Member Licensed User

    no...they are labelled sequentially but you use event "click".but i want "ButtonDown" event!!!and it is big problem
     
  12. agraham

    agraham Expert Licensed User

    I'm sorry but I don't understand the problem. You would just replace "click" with "buttondown" and it will work compiled but not in the IDE until the bug is fixed.
     
  13. Byak@

    Byak@ Active Member Licensed User

    oh?,sorry)now i understand!thnx
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice