Combobox - mark text and place cursor at the end in the SLE part of the CB
Posted: Sun Aug 01, 2021 4:58 pm
Hello,
after more than 10 years of abstinence from VO, I have to make some changes in an application (VO 2.8 SP4b) for my previous client.
Several combo boxes should be given an autofill function. This also works quite well so far. A text suggestion is written into the edit control of the combo box, only the cursor is placed at the beginning. However, the text change should be marked and the cursor should be placed at the end.
I implemented the search for a text suggestion in '__EditChange'.
How can I solve the problem?
doesn't work or is not available.
Thanks for the help and sorry for my bad english.
Harry
after more than 10 years of abstinence from VO, I have to make some changes in an application (VO 2.8 SP4b) for my previous client.
Several combo boxes should be given an autofill function. This also works quite well so far. A text suggestion is written into the edit control of the combo box, only the cursor is placed at the beginning. However, the text change should be marked and the cursor should be placed at the end.
I implemented the search for a text suggestion in '__EditChange'.
Code: Select all
METHOD __EditChange() AS VOID PASCAL CLASS cmbAutoFill
//
// CurrenText in dem Item-Array suchen
//
LOCAL dwItemNo AS DWORD
LOCAL cValue AS STRING
LOCAL dwLenValue AS DWORD
SUPER:__EditChange()
cValue := SELF:CurrentText
dwLenValue := SLen(cValue)
IF SLen(cValue) > 0
IF (dwItemNo := AScan(SELF:_aItemList, {|x| Upper(x) = Upper(cValue)})) > 0
SELF:CurrentText := AllTrim(SELF:_aItemList[dwItemNo])
ENDIF
ENDIF
RETURN
Code: Select all
SELF:selection := Selection {dwOldCurPos, -1}
Thanks for the help and sorry for my bad english.
Harry