Closing Listbox.EditCell by code

I need to close editing a cell by code.
I’ve read LR looking for a method to do it, but I can’t find any help.
I’ve tried:

myListBox.ActiveCell.Close >> does nothing
myListBox.EditCell(-1, -1) >> error

Any hint?
Thanks

Raise the CellLostFocus event?

Or call the InvalidateCell method?

listbox1.Enabled = false listbox1.enabled = true

Thanks Markus and Michel.
I can not try it at this moment but I’ll do it later.

Both methods with invalidate and enabled work.

I have never needed to do that, but I would try just setting the focus back to the listbox.

self.setFocus

That’s all!

[quote=167129:@Massimo Valle]self.setFocus

That’s all![/quote]

Isn’t that what I said? :wink:

  • Karen

[quote=167157:@Karen Atkocius]Isn’t that what I said? :wink:

  • Karen[/quote]
    Nope.

You said me.setFocus (which is better)

Thanks for all your contributions, but unfortunately none of them was good enough.
Behaviour of ActiveCell is very erratic, it changes from Windows to Mac, and from one situation to another. In fact I think that most of this misbehaviour is due to the bugs commented by Massimo Valle in https://forum.xojo.com/18302-listbox-problems

In this picture
you can see what I pretend: edit a cell both from inside (keyboard) and selecting bars from the drawing with the mouse.
The truth is I’ve checked dozens of alternatives with no satisfactory result. Some times it works, some times not and Windows and Mac have different behaviour and this is a cross platform software.
So I will have to change my approach and try another one.
Thanks anyway.