Anybody knows how to search and re-search a piece of text within an editbox.
I now have this code which works fine except to continue search is not feasible with AT function:
Code: Select all
c_EDITBOX_TEXT := Form_TXT.EDITBOX_TEXT.Value // very long text
x_SEARCH_TXT := Form_TXT.SEARCH_TXT.Value // some short text to be found
nPOS := AT(UPPER(x_SEARCH_TXT), UPPER(c_EDITBOX_TEXT))
TextBoxEditSetSel( 'Form_TXT', 'EDITBOX_TEXT', nPOS-1, ( nPOS-1 + LEN(x_SEARCH_TXT)))
Form_TXT.EDITBOX_TEXT.Setfocus
...
/* this comes from Mr. Claudio SOTO */
FUNCTION TextBoxEditSetSel( cParent, cControl, nStart, nEnd )
/***********************************************************/
LOCAL nHandle := GetControlHandle( cControl, cParent )
TextBoxSetSel( nHandle, nStart, nEnd )
RETURN nil
#pragma BEGINDUMP
#include <windows.h>
#include <commctrl.h>
#include "hbapi.h"
#include <wingdi.h>
HB_FUNC ( TEXTBOXSETSEL )
{
HWND hWnd1;
hWnd1 = (HWND) hb_parnl (1);
SendMessage((HWND) hWnd1,EM_SETSEL, (WPARAM)(int) hb_parni(2),(LPARAM) (int) hb_parni(3));
}