Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Way to find .Left for grid textboxes
Message
From
20/04/2004 07:42:28
 
 
To
19/04/2004 15:21:13
Dorin Vasilescu
ALL Trans Romania
Arad, Romania
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00896052
Message ID:
00896423
Views:
9
Dorin, OBJTOCLIENT() into the grid,
it have equal behaviour in VFP6SP5,VFP7SP1 and VFP8SP1.

Run this, i get correct Top,Left values:
PUBLIC oform1

oform1=NEWOBJECT("form1")
oform1.Show
RETURN

DEFINE CLASS form1 AS form

	Top = 3
	Caption = "ObjToClient is OK"
*	ShowWindow = 2 you can test this into VCX ( a bug on WAIT command )
	
	ADD OBJECT grid1 AS grid WITH ;
		ColumnCount = 2, ;
		Left = 20, ;
		Top = 16, ;
		Width = 320

	PROCEDURE Load
		CREATE CURSOR myCursor (myField1 C(10) DEFAULT STR(RECCOUNT());
							,	myField2 C(10) DEFAULT STR(RECCOUNT()))
		FOR k=1 TO 10
		APPEND BLANK
		NEXT
		LOCATE
	ENDPROC


	PROCEDURE grid1.AfterRowColChange(colOrder)
		WAIT windows 'Active cell Top  :'+STR(OBJTOCLIENT(this.Columns(M.colOrder).Text1,1)) ;
			+CHR(13)+'                 Left :'+STR(OBJTOCLIENT(this.Columns(M.colOrder).Text1,2)) NOWAIT noclear
	ENDPROC

ENDDEFINE
VFP return 4000 if you request the Top,Left for a not active cell,
( Hovewer on this mechanism exist a bug, because i have see not repetable values
into the same Form );
it must return the correct value for Left ( because it is deterministic ),
and Top value of column because ActiveRow is 0.

Fabio
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform