Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Selstart,sellength not working
Message
From
13/06/2006 09:20:28
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
13/06/2006 09:14:53
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01128669
Message ID:
01128671
Views:
26
This message has been marked as a message which has helped to the initial question of the thread.
I recently tried something similar, and the text was only highlighted when the textbox got the focus.

Try one of the following:

  • After running your code, press TAB until you get to the EditBox. Or:
  • Add a ThisForm.Edit1.SetFocus(). The form Refresh() is not necessary in this case.

    Also, obviously, you must check whether the condition ever becomes .T. A MessageBox() right after the IF might help in determining this.

    >i have an editbox and the following code (simplified) does NOT highlight the text:
    >
    >xx1=UPPER(ALLTRIM(thisform.text1.Value))
    >xx2=UPPER(thisform.edit1.Value)
    >
    >x1=AT(xx1,xx2)
    >
    >IF x1>0
    >	thisform.edit1.selectedbackColor=RGB(255,0,0)
    >	thisform.edit1.SelStart=x1
    >	thisform.edit1.SelLength=LEN(xx1)
    >	thisform.edit1.SelText=xx1
    >	thisform.edit1.Refresh()
    >	
    >ENDIF
    >
    >
    >
    >what am I missing???
    >
    >thanks
    >
    >
    >Peter
    Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
  • Previous
    Next
    Reply
    Map
    View

    Click here to load this message in the networking platform