Listbox input

  1. 2 weeks ago

    Volbragt E

    Jun 25 Testers Belgium

    Windows 10 / XOJO 2018r4

    Is there a way to limit the input value in a editable listbox cell.
    The input must be between 0 and 127. It may not exceed 127.

    Thanks
    Regards
    Etienne

  2. Tim P

    Jun 25 Testers, Xojo Pro Rochester, NY

    You have the opportunity to validate the entered value in the https://docs.xojo.com/ListBox.CellAction event.

  3. Volbragt E

    Jun 25 Testers Belgium

    Hi Tim,

    Correct, that is what I am doing for the moment.
    But I was trying to limiting the typing in the cell.
    It would already be helpful if the number of charactres could be limited to 3 while entering.

    regards
    Etienne

  4. Tim P

    Jun 25 Testers, Xojo Pro Rochester, NY

    It looks like https://docs.xojo.com/ListBox.ActiveTextControl returns an actual TextEdit field, so you may be able to set a limit text or mask on that. I haven't tested this idea though.

  5. I would use CellKeyDown to validate each character (i.e. digits) and CellAction to validate the complete entry. ActiveTextControl is an API2 thing.

  6. Tim P

    Jun 25 Testers, Xojo Pro Rochester, NY

    @LangueRodriguez I would use CellKeyDown to validate each character (i.e. digits) and CellAction to validate the complete entry. ActiveTextControl is an API2 thing.

    That's a good idea as well. By the way, https://docs.xojo.com/ListBox.ActiveCell is the API 1.0 name.

  7. Norman P

    Jun 25 Testers, Xojo Pro outside admiring the sunshine,...

    I tend to create a "cell editor handler" and then the rowtag holds an instance and the listbox itself then checks to see if the specific event should be delegated to one of these (ie/ if there is a rowtag then it calls the delegates method)
    then I can have each draw the cell in whatever way I want, handle keydowns clicks etc etc etc all in a reusable and extensible way

or Sign Up to reply!