请高手指点!!
在网页中可以将数据库中的某一字段分页列一表格,通过链接点击打开该记录详细情况,就论坛中点击链接打开记录。我从网上下载一个现成的单机版软件是用的是access数据库,能达到网页那种效果。
请问VFP能达到这种效果吗,在表单中用表格列表中出全部记录中某一字段,点击某一记录,在一同表单中可打开该记录,用文本框显示更多的记录信息。就像网页两个框架一个,左边无表,右边就显详细,点哪个显示哪个。
CLEAR ALL Form1 = NEWOBJECT("CForm") Form1.Show READ EVENTS RETURN DEFINE CLASS CForm AS Form Caption = "×ÛºÏÐÅÏ¢Çé¿ö" MinWidth = 800 WindowState = 2 ADD OBJECT Grid1 AS Grid ADD OBJECT Container1 AS Container PROCEDURE Grid1.Init WITH This .HighlightStyle = 2 .RecordSourceType = 1 .RecordSource = "rygl" ENDWITH ENDPROC PROCEDURE Grid1.AfterRowColChange(tnColumnIndex) SET ORDER TO ±àºÅ IN grqk SEEK rygl.±àºÅ IN grqk ThisForm.Container1.Refresh ENDPROC PROCEDURE Container1.Init LOCAL lnWidth, lnHeight, lnIndex, lcCaption, lcDataSource WITH This .SpecialEffect = 1 .AddProperty("GetArray[" + TRANSFORM(FCOUNT("grqk")) + "]") FOR lnIndex = 1 TO FCOUNT("grqk") lcCaption = FIELD(lnIndex, "grqk") + ":" lcDataSource = "grqk." + FIELD(lnIndex, "grqk") .AddObject(".GetArray[" + TRANSFORM(lnIndex) + "]", "CGet", lcCaption, lcDataSource) WITH .GetArray[lnIndex] .Top = 5 + (lnIndex - 1) * (.Height + 5) .Left = 5 ENDWITH NEXT ENDWITH ENDPROC PROCEDURE Arrange WITH ThisForm.Grid1 .Top = 5 .Left = 5 .Width = 500 .Height = ThisForm.Height - .Top - 5 ENDWITH WITH ThisForm.Container1 .Top = 5 .Left = ThisForm.Grid1.Left + ThisForm.Grid1.Width + 5 .Width = ThisForm.Width - .Left - 5 .Height = ThisForm.Height - .Top - 5 .SetAll("MaxWidth", .Width - 10, "CGet") .Refresh ENDWITH ENDPROC PROCEDURE Load OPEN DATABASE rygl USE rygl IN 0 USE grqk IN 0 ENDPROC PROCEDURE Unload SET DATABASE TO rygl CLOSE DATABASES ENDPROC PROCEDURE Activate ThisForm.Arrange ENDPROC PROCEDURE Resize ThisForm.Arrange ENDPROC PROCEDURE Destroy CLEAR EVENTS ENDPROC ENDDEFINE DEFINE CLASS CGet AS Container BorderWidth = 0 Visible = .T. MaxWidth = 300 HIDDEN _Caption, _DataSource _Caption = "" _DataSource = "" ADD OBJECT PROTECTED Label1 AS Label WITH Width = 100, Height = 25, Alignment = 1, FontBold = .T. ADD OBJECT PROTECTED TextBox1 AS TextBox WITH Height = 25, Enabled = .F. PROCEDURE Init(tcCaption, tcDataSource) WITH This ._Caption = tcCaption ._DataSource = tcDataSource WITH .Label1 .Caption = .Parent._Caption .Top = 0 .Left = 0 ENDWITH WITH .TextBox1 .Top = 0 .Left = This.Label1.Left + This.Label1.Width + 5 ENDWITH .Height = MAX(.Label1.Height, .TextBox1.Height) ENDWITH ENDPROC PROCEDURE Refresh WITH This.TextBox1 .Value = EVALUATE(This._DataSource) .Width = LENC(.Value) * 20 ENDWITH WITH This .Width = MIN(.TextBox1.Left + .TextBox1.Width, .MaxWidth) ENDWITH ENDPROC ENDDEFINE