Page 1 of 1

text selection bug

Posted: 09 Jul 2013, 11:45
by badrepent
Good morning to all,
I find one annoying bug in "SelectedText" property of Textbox control. When you ask for selected text in a particular selection scenario it fail and
give the selected text except the last charachter.
To reproduce the issue you need to select some text inside textbox starting from last char to the first one and you will see that selected text
will not contain the last char.
To fix this issue and to see it in your code I use the following code (I use windows api directly on textbox hwnd to get the real selection length):

Code: Select all

Public Property Get SelLength() As Long
   Debug.Print (Len(txtText.SelectedText))
    Dim startpos As Long
    Dim endpos As Long
    Call SendMessage(txtText.hWnd, EM_GETSEL, startpos, endpos)
    SelLength = endpos - startpos
End Property

HTH,
Luca

Re: text selection bug

Posted: 09 Jul 2013, 21:41
by TiKu
Hi,

thanks for reporting this. It'll be fixed in the next release, which will probably be published during the weekend.

Regards
TiKu