Using SELECTION property (OpenInsight 32-Bit)
At 03 JAN 2005 05:46:57PM Don Muskopf wrote:
I am trying to use a stored procedure to select all the text in an EDITLINE control on the GOTFOCUS event. If I run the event handler below, it works correctly. All text is hi-lighted.
Declare Function Set_PropertyAllText=1:@fm:65534RtnSelection=Set_Property(ctrlEntId, "SELECTION", AllText)RETURN 0However, if I run the following stored procedure, either as an Event or as a Quickevent, it does NOT work correctly. No text is hi-lighted.
Declare Function Set_Property
ControlName=Get_Property(@window, "FOCUS")
AllText=1:@fm:65534
RtnSelection=Set_Property (@window : '.ControlName', "SELECTION", AllText)
RETURN 0
RtnSelection returns null. ControlName is returned correctly.
Does anyone know how to do this in a stored procedure?
Thanks.
At 03 JAN 2005 06:40PM Donald Bakke wrote:
Don,
The problem is in your code. First, you are using @Window before the ControlName variable which is redundant since ControlName will already contain the fully qualified control entity ID (i.e. Window.Control). Your other problem is that you have quotes around the ControlName variable so it will be treated as a literal. Here is the modified code that should work:
Declare Function Set_Property
ControlName=Get_Property(@window, "FOCUS")
AllText=1:@fm:65534
RtnSelection=Set_Property (ControlName, "SELECTION", AllText)
RETURN 0
dbakke@srpcs.com
At 03 JAN 2005 08:18PM Don Muskopf wrote:
Thanks, Don. It works fine now.