以下是引用TonyDeng在2012-10-5 16:20:54的发言:
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
搞什么鬼?我的中文不见啦!
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
搞什么鬼?我的中文不见啦!
。搞的就是你的中文 谁叫你文学水平高ne...
梅尚程荀
马谭杨奚