text selection bug

The place for threads about TimoSoft EditControls.
Post Reply
badrepent
Cadet
Posts: 3
Joined: 08 Jul 2013, 14:24

text selection bug

Post 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
User avatar
TiKu
Administrator
Administrator
Posts: 832
Joined: 28 Sep 2004, 21:10
Location: München
Contact:

Re: text selection bug

Post 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
Crunching for Fab36_Folding-Division at Folding@Home. Join Fab36/Fab30! - Folding@Home and BOINC
Boycott DRM! Boycott HDCP!
Post Reply