Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid & editbox,cursor moving to the beginning of the edi
Message
From
01/02/2005 11:55:56
Kari Sinivuori
Atk-Palvelu K.Sinivuori
Tuusula, Finland
 
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 6 SP5
Miscellaneous
Thread ID:
00981104
Message ID:
00982717
Views:
34
Sorry Terry that I didn't made myself clear.
Here is sample code to reproduce this oddity. If you can figure out what is wrong then you probably can help me :-) Run this program and try edit both edibox and memo field. Then you should figure out what I ment.
-kari

**** Code begins ****
CLOSE ALL
CREATE CURSOR Qtest (;
Address M,;
Invoice M,;
Id I)

INSERT INTO Qtest VALUES ('Start writing here at the End..','Start writing here at the End..',1)
INSERT INTO Qtest VALUES ('Start writing here at the End..','Start writing here at the End..',2)
INSERT INTO Qtest VALUES ('Start writing here at the End..','Start writing here at the End..',3)
INSERT INTO Qtest VALUES ('Start writing here at the End..','Start writing here at the End..',4)
INSERT INTO Qtest VALUES ('Start writing here at the End..','Lasku105',5)


loForm = CREATEOBJECT('Form') && Create a Form
WITH loForm
.Closable = .F.
.WIDTH = 580
.Height = 300
.AddObject('cmdTest','cmdBtn') && Add Command button
.AddObject('pgf1','Pageframe')
With .Pgf1
.Width = 500
.height = .parent.height
.pageCount = 2
.Visible = .T.
.Activepage = 2
WITH .page2
.AddObject('grdGrid','Grid') && Add Grid control
WITH .grdGrid
.Left = 5
.Top = 5
.Width = 490
.Height = 260
.Rowheight = 50
.Visible = .T. && Grid control visible
.enabled = .T.
.Deletecolumn(1)
.Deletecolumn(2)
.Addcolumn(1)
.Addcolumn(2)
WITH .Column1
.Name = 'Address'
.Width = 200
.ControlSource = 'Qtest.Address'
.Bound = .F.
.Addobject('edtAddress','grdeditbox')
.edtAddress.Controlsource = 'Qtest.Address'
.edtAddress.VISIBLE = .T.
.Bound = .T.
.Currentcontrol = 'edtAddress'
.Sparse = .F.
.Header1.Caption = 'Address'
ENDWITH
WITH .Column2
.Name = 'Invoice'
.Width = 200
.ControlSource = 'Qtest.Invoice'
.Addobject('edtInvoice','grdeditbox')
.edtInvoice.Visible = .T.
.Currentcontrol = 'edtInvoice'
.Sparse = .T.
.Header1.Caption = 'Inmvoice'
ENDWITH
ENDWITH
ENDWITH
ENDWITH
.cmdTest.Visible =.T. && "Quit" Command button visible
.SHOW && Display the form
LOCATE
.Refresh()
READ EVENTS && Start event processing
ENDWITH

DEFINE CLASS cmdBtn AS CommandButton
Caption = '\ Cancel = .T.
Left = 505
Top = 5
Height = 25
Width = 70

PROCEDURE Click
CLEAR EVENTS
CLOSE ALL
ENDPROC
ENDDEFINE

DEFINE CLASS grdEditbox AS Editbox
Enabled = .T.
BorderStyle = 0
SelectOnEntry = .F.

PROCEDURE InterActiveChange
IF NOT This.parent.sparse
WAIT "Cursor moves to the beginnig of the line. Not good " + TRAN(This.Selstart) WINDOW NOWAIT
ELSE
WAIT "Cursor doesn't move. Good "+ TRAN(This.Selstart) WINDOW NOWAIT
ENDIF
Thisform.pgf1.Page1.Enabled = .F. && This line causes the trouble
ENDPROC
ENDDEFINE

**** Code Ends ****
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform