In a textfield you go to the end of the text with :
TextField.SelStart = TextField.Text.Len
But how can I do the same with the text in a listbox-cell ?
In a textfield you go to the end of the text with :
TextField.SelStart = TextField.Text.Len
But how can I do the same with the text in a listbox-cell ?
Menu Edit, Option SelectAll ?
Yes, it works !
I mean without going to the menu, but by using code.
Here is a sample :
MyListbox.CellType(0, 0) = Listbox.TypeEditable
MyListbox.EditCell(0,0)
In that cell there is text and I want to add text or change the text.
When the cell gets the focus, ALL the text is selected.
I want that the cursor is at the end of the text.
In Listbox.CellGotFocus
try
me.ActiveCell.SelStart = me.ActiveCell.Text.Len
Tx Karen, I tried it, but it does not work.
Karen, when I put your code directly after my code like this :
MyListbox.CellType(0, 0) = Listbox.TypeEditable
MyListbox.EditCell(0,0)
MyListbox.ActiveCell.SelStart = MyListbox.ActiveCell.Text.Len
instead of in MyListbox.CellGotFocus, than
IT WORKS !!!
Thank you very much.
So my problem is solved.