Android Question Radio Buttons Event

Discussion in 'Android Questions' started by davelt99, Nov 3, 2016.

  1. davelt99

    davelt99 Member Licensed User

    I've created three global radio buttons, rb1,rb2,rb3.
    When loading a Layout, I initialize them with an event name "showTasks" and then add all three to a panel that has been created in the Designer.

    My problem is that when a rb1, rb2 or rb3 is Clicked, the showTasks event never fires.

    {sub Globals
    .....
    dim rb1,rb2,rb3 as radiobutton
    end sub

    sub LoadLayout
    rb1.initialize("showTasks")
    rb1.tag="radio1"
    rb2.initialize("showTasks")
    rb2.tag="radio2"
    rb3.initialize("showTasks")
    rb3.tag="radio3"
    pnl.AddView(rb1,0dip,5dip,90dip,27dip)
    pnl.AddView(rb2,120dip,5dip,90dip,27dip)
    pnl.AddView(rb3,250dip,5dip,90dip,27dip)
    end sub

    sub showTasks()
    dim r as radiobutton
    r=sender
    log(r.tag)

    end sub
    }
     
  2. DonManfred

    DonManfred Expert Licensed User

    I dont think that showtask is the right eventName
    I mean the Sub signature

    Probably showtask_click?
     
  3. davelt99

    davelt99 Member Licensed User

    Thanks. Tried the showTasks_Click but that didn't fire either.
     
  4. klaus

    klaus Expert Licensed User

    The event is showTasks_CheckedChange(Checked As Boolean)
     
    Cableguy and DonManfred like this.
  5. Cableguy

    Cableguy Expert Licensed User

    The auto-completion feature is a powerful friend!
    When you type "sub " and the hit tab, a list of controls appears and upon selecting one, the relevant events are selectable! The only thing you need to add is the event name!
     
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