关于表所在列的判断
-个表与表格控件绑定,当我点击表格件某一个单元格,如何返回单元格所在列对应表所在列的字段名
* Grid表格中移动鼠标获取指向单元格数据 of = CREATEOBJECT("form1") of.show(1) DEFINE CLASS form1 As Form Height = 300 Width = 420 AutoCenter = .T. Add Object Grid1 As Grid WITH AllowCellSelection=.F. PROCEDURE Load CREATE CURSOR TEMP (F1 C(10), F2 C(10), F3 I) INSERT INTO TEMP VALUES ("ABC", "123456", 101) INSERT INTO TEMP VALUES ("DEF", "654321", 202) INSERT INTO TEMP VALUES ("GHI", "456123", 303) INSERT INTO TEMP VALUES ("JKL", "789456", 404) INSERT INTO TEMP VALUES ("NMO", "123789", 505) INSERT INTO TEMP VALUES ("ABC", "123456", 101) INSERT INTO TEMP VALUES ("DEF", "654321", 202) INSERT INTO TEMP VALUES ("GHI", "456123", 303) GO TOP ENDPROC PROCEDURE _MouseMove LPARAMETERS nButton, nShift, nXCoord, nYCoord LOCAL nWhere, nRelRow, nRelCol nWhere = 0 nRelRow = 0 nRelCol = 0 IF thisform.Grid1.GridHitTest(nXCoord, nYCoord, @nWhere, @nRelRow, @nRelCol) IF nWhere == 3 && 单元格 thisform.Grid1.ActivateCell(nRelRow, nRelCol) * 显示单元格数据 thisform.Caption = "("+TRANSFORM(nRelRow)+":"+TRANSFORM(nRelCol)+")"; +TRANSFORM(thisform.Grid1.Columns[nRelCol].Text1.Value) ENDIF ENDIF ENDPROC PROCEDURE Grid1.Init this.setall("alignment", 2, "column") this.HighlightBackColor = this.BackColor this.HighlightForeColor = this.ForeColor BINDEVENT(this, "MouseMove", thisform, "_MouseMove") ENDPROC ENDDEFINE