Closing app while in editcell mode

  1. last week

    Dale A

    Nov 30 San Diego, California, USA

    I recently ran across a situation where if the user is editing a cell in a listbox and clicks the app's close box, the app generates a runtime error. To get around the problem (in an admittedly ugly fashion), in the window's Close handler I force a different control to get the focus. By doing this, the edits in the cell are lost, as they should be, and the runtime error is circumvented.

    My question is this: is this really the best way to handle it or is there a "proper" approach?

    Thanks.

    BTW, if it makes any difference, I'm running 2018r3 on a Windows 10 system.

  2. Dave S

    Nov 30 San Diego, California USA
    1. abort the close (CancelClose) if activeCell
    2. or in Cancel close ... force completion of the edit

    either should avoid a run-time error

  3. Greg O

    Nov 30 Xojo Inc

    @Dale A I recently ran across a situation where if the user is editing a cell in a listbox and clicks the app's close box, the app generates a runtime error. To get around the problem (in an admittedly ugly fashion), in the window's Close handler I force a different control to get the focus. By doing this, the edits in the cell are lost, as they should be, and the runtime error is circumvented.

    My question is this: is this really the best way to handle it or is there a "proper" approach?

    Thanks.

    BTW, if it makes any difference, I'm running 2018r3 on a Windows 10 system.

    Could you post the text that's in the Runtime Error dialog?

  4. Dale A

    Dec 2 San Diego, California, USA

    @Greg OLone Could you post the text that's in the Runtime Error dialog?

    Runtime Error
    Press OK to Continue
    Press Cancel to Quit.
    
    Please report what caused this error
    along with the information below.
    
    Universal\REALstring.cpp: 130
    Failure Condition: usageCount
  5. Julian S

    Dec 3 Pre-Release Testers, Xojo Pro UK

    Its a known bug from June Feedback Case #52488 I just do a listbox.SetFocus() inside CancelClose

  6. Dale A

    Dec 3 San Diego, California, USA

    @Julian S Its a known bug from June Feedback Case #52488 I just do a listbox.SetFocus() inside CancelClose

    Yeah, that's what I wound up doing.

or Sign Up to reply!