citakumedia
Programmer
- Feb 18, 2014
- 4
i have project1 with form1 and class grid in the class libraries.
form1 including texbox1, textbox2 and textbox3. tab order in the form1 starting from textbox1, textbox2 and textbox3.
in the textbox2 has code which is calling class grid in the class libraries like this:
textbox2 procedure interactivechange
If Empty(This.Value)
With Thisform.Grid1
.Visible=.F.
Endwith
RETURN
Endif
SELECT * From cData Where Upper(Alltrim(This.Value))$;
UPPER(Alltrim(cNama))+Upper(Alltrim(cAlamat));
INTO Cursor cDataku
With Thisform.Grid1
.Visible=.T.
.oTable='cDataku'
.oName=this.Name
.oField="ALLTRIM(cAlamat)"
.RecordSourceType=1
.RecordSource='cDataku'
.Column1.Width=100
.Column2.Width=200
.Column3.Width=100
Endwith
RETURN
in the class grid procedure keypress
LPARAMETERS nKeyCode, nShiftAltCtrl
IF nKeyCode=13
lcTable=ALLTRIM(this.otable)
lcNama=ALLTRIM(this.oName)
lcField=this.ofield
SELECT &lcTable
thisform.&lcNama..value=&lcField
this.visible= .F.
ELSE
IF nKeyCode=7
lcNama=ALLTRIM(this.oName)
thisform.&lcNama..value=''
this.Visible= .F.
ENDIF
ENDIF
the problem is how to set the focus after pick the value from the class grid with use doubleclick or enter and directly change the focus to setfocus to the textbox3 in the form1?
form1 including texbox1, textbox2 and textbox3. tab order in the form1 starting from textbox1, textbox2 and textbox3.
in the textbox2 has code which is calling class grid in the class libraries like this:
textbox2 procedure interactivechange
If Empty(This.Value)
With Thisform.Grid1
.Visible=.F.
Endwith
RETURN
Endif
SELECT * From cData Where Upper(Alltrim(This.Value))$;
UPPER(Alltrim(cNama))+Upper(Alltrim(cAlamat));
INTO Cursor cDataku
With Thisform.Grid1
.Visible=.T.
.oTable='cDataku'
.oName=this.Name
.oField="ALLTRIM(cAlamat)"
.RecordSourceType=1
.RecordSource='cDataku'
.Column1.Width=100
.Column2.Width=200
.Column3.Width=100
Endwith
RETURN
in the class grid procedure keypress
LPARAMETERS nKeyCode, nShiftAltCtrl
IF nKeyCode=13
lcTable=ALLTRIM(this.otable)
lcNama=ALLTRIM(this.oName)
lcField=this.ofield
SELECT &lcTable
thisform.&lcNama..value=&lcField
this.visible= .F.
ELSE
IF nKeyCode=7
lcNama=ALLTRIM(this.oName)
thisform.&lcNama..value=''
this.Visible= .F.
ENDIF
ENDIF
the problem is how to set the focus after pick the value from the class grid with use doubleclick or enter and directly change the focus to setfocus to the textbox3 in the form1?