Subject Re: OnClick?
From Akshat Kapoor <akshat.kapoor@kapoorsons.in>
Date Sat, 19 Jun 2021 11:45:16 +0530
Newsgroups dbase.getting-started

Good Morning Roy,

> I have a simple form to add data to a file, as in the code below.
>
> The user (wife) has difficulty understanding the placement of the mouse
> click should be at the beginning (left side) of the entryfield before
> entering data.
>
> How can I force the initial mouse click to the leftmost position?
> Regards
> Roy Price
>
>   this.ENTRYFIELDTEMPBEFORE1 = new ENTRYFIELD(this)
>     with (this.ENTRYFIELDTEMPBEFORE1)
>        dataLink = form.dialysisrecord1.rowset.fields["tempbefore"]
onGotFocus = {;this.keyboard( "{Home}" )}
>        height = 33.0
>        left = 147.0
>        top = 220.0
>        width = 91.0
>        picture = "99.99"
>        function = "J"
>        fontSize = 18.0
>     endwith

Adding the above line should solve your problem.
The above line is not tested.
In case of errors remove the line
Add a onGotFocus event using inspector
Click on the spanner to modify the code
and paste the following line in the code

this.keyboard( "{Home}" )

  prefer to use the following as my custom entryfield

class mun_ENTRYFIELD(parentObj) of ENTRYFIELD(parentObj) custom
    with (this)
       onGotFocus = class::ENTRYFIELD_ONGOTFOCUS
       height = 1.5
       left = 11.0
       top = 7.5
       selectAll = true
       width = 22.0
       metric = 0        // Chars
       value = "Entryfield1"
    endwith

    function ENTRYFIELD_onGotFocus()
       this.keyboard( "{Home}" )
       return
endclass

Use selectAll = true with caution

Regards
Akshat