标题:请高手指点!!
只看楼主
有容就大
Rank: 16Rank: 16Rank: 16Rank: 16
来 自:东土大唐
等 级:版主
威 望:74
帖 子:9048
专家分:14309
注 册:2011-11-11
得分:0 
以下是引用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

搞什么鬼?我的中文不见啦!

。搞的就是你的中文 谁叫你文学水平高ne...

梅尚程荀
马谭杨奚







                                                       
2012-10-06 22:31
TonyDeng
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
等 级:贵宾
威 望:304
帖 子:25859
专家分:48889
注 册:2011-6-22
得分:0 
回复 11楼 有容就大
你能贴出中文吗?

授人以渔,不授人以鱼。
2012-10-07 16:26
有容就大
Rank: 16Rank: 16Rank: 16Rank: 16
来 自:东土大唐
等 级:版主
威 望:74
帖 子:9048
专家分:14309
注 册:2011-11-11
得分:0 
以下是引用TonyDeng在2012-10-7 16:26:45的发言:

你能贴出中文吗?

老大你中标了吧。


梅尚程荀
马谭杨奚







                                                       
2012-10-07 18:37



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-382552-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.167874 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved