| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 2026 人关注过本帖
标题:还是改成容器吧,编程的时候好处理一点
只看楼主 加入收藏
不懂才问
Rank: 15Rank: 15Rank: 15Rank: 15Rank: 15
来 自:大草原
等 级:贵宾
威 望:29
帖 子:1503
专家分:6593
注 册:2010-7-5
结帖率:91.53%
收藏
已结贴  问题点数:100 回复次数:14 
还是改成容器吧,编程的时候好处理一点
程序代码:
    PROCEDURE howManyLine.upClick &&rtnMainBtn.click
        IF thisform.currLine<4
            clflCbxNum="clflCbx"+ALLTRIM(STR(thisform.howManyLine.value))
            clmcCbxNum="clmcCbx"+ALLTRIM(STR(thisform.howManyLine.value))
            jldwCbxNum="jldwCbx"+ALLTRIM(STR(thisform.howManyLine.value))
            ssslTxtNum="ssslTxt"+ALLTRIM(STR(thisform.howManyLine.value))
            grdjTxtNum="grdjTxt"+ALLTRIM(STR(thisform.howManyLine.value))
            grjeTxtNum="grjeTxt"+ALLTRIM(STR(thisform.howManyLine.value))
            bzdjTxtNum="bzdjTxt"+ALLTRIM(STR(thisform.howManyLine.value))
            bzjeTxtNum="bzjeTxt"+ALLTRIM(STR(thisform.howManyLine.value))
            cjTxtNum="cjTxt"+ALLTRIM(STR(thisform.howManyLine.value))
            bgddCbxNum="bgddCbx"+ALLTRIM(STR(thisform.howManyLine.value))
           
            thisform.addobject('&clflCbxNum','comboBox')
            thisform.addobject('&clmcCbxNum','comboBox')
            thisform.addobject('&jldwCbxNum','comboBox')
            thisform.addobject('&ssslTxtNum','textBox')
            thisform.addobject('&grdjTxtNum','textBox')
            thisform.addobject('&grjeTxtNum','textBox')
            thisform.addobject('&bzdjTxtNum','textBox')
            thisform.addobject('&bzjeTxtNum','textBox')
            thisform.addobject('&cjTxtNum','textBox')
            thisform.addobject('&bgddCbxNum','comboBox')
           
            Thisform.Arrange
        ELSE
            MESSAGEBOX("1单内最多只能有4项材料入账",64,"操作提示!")       
        ENDIF
    ENDPROC 

    PROCEDURE howManyLine.downClick &&rtnMainBtn.click
        IF thisform.currLine>1
            clflCbxNum="clflCbx"+ALLTRIM(STR(thisform.howManyLine.value+1))
            clmcCbxNum="clmcCbx"+ALLTRIM(STR(thisform.howManyLine.value+1))
            jldwCbxNum="jldwCbx"+ALLTRIM(STR(thisform.howManyLine.value+1))
            ssslTxtNum="ssslTxt"+ALLTRIM(STR(thisform.howManyLine.value+1))
            grdjTxtNum="grdjTxt"+ALLTRIM(STR(thisform.howManyLine.value+1))
            grjeTxtNum="grjeTxt"+ALLTRIM(STR(thisform.howManyLine.value+1))
            bzdjTxtNum="bzdjTxt"+ALLTRIM(STR(thisform.howManyLine.value+1))
            bzjeTxtNum="bzjeTxt"+ALLTRIM(STR(thisform.howManyLine.value+1))
            cjTxtNum="cjTxt"+ALLTRIM(STR(thisform.howManyLine.value+1))
            bgddCbxNum="bgddCbx"+ALLTRIM(STR(thisform.howManyLine.value+1))

            thisform.removeObject('&clflCbxNum')
            thisform.removeObject('&clmcCbxNum')
            thisform.removeObject('&jldwCbxNum')
            thisform.removeObject('&ssslTxtNum')
            thisform.removeObject('&grdjTxtNum')
            thisform.removeObject('&grjeTxtNum')
            thisform.removeObject('&bzdjTxtNum')
            thisform.removeObject('&bzjeTxtNum')
            thisform.removeObject('&cjTxtNum')
            thisform.removeObject('&bgddCbxNum')
           
            Thisform.Arrange
        ELSE
            MESSAGEBOX("1单内至少要有1项材料入账",64,"操作提示!")       
        ENDIF
    ENDPROC 

一个一个的添加,是不是相应的数据关联,也要一个一个的做?好像是挺。。。。。。

现在换成容器,但是大脑里,对于容器内各控件间距,各控件命名和以后的引用,还有容器和表单上面和下面的控件间的定位,缩放、字号大小调整

所有概念都很模糊,T版说,这种时候,先用语言描述一遍逻辑,再把汉语换成编程语言。。。。。。

那我就说了 ,,,   不对的地方  各位老师指正一下
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
&&收料单
    略,,,
   
    添加第三条直线 with top=上一行控件的底+三倍行距
    添加容器a  with top=第三条直线的底+三倍行距,left=第三条直线的left,width=第三条直线的宽
    添加第四条直线 with top=容器a的底+三倍行距
    添加退出按钮等,在第四条直线下面

    略,,,

    procedure Arrange
        if type(第四行第一个控件)=="o"
            容器a的高=第三条直线的底+4行控件的高+三倍行距
        endif
        if type(第三行第一个控件)=="o"
            容器a的高=第三条直线的底+3行控件的高+两倍行距
        endif
        if type(第二行第一个控件)=="o"
            容器a的高=第三条直线的底+2行控件的高+一倍行距
        endif
        if type(第一行第一个控件)=="o"
            容器a的高=第三条直线的底+1行控件的高
        endif            
    endproc

    procedure init
        select 2    &&按表的建立顺序,每个表在固定工作区打开
        use datas\收料明细
        go top
        if bof()
            容器b.addobject('容器b1','容器')
            各种按钮状态的调节
        else
            查询最后一条收料明细的账单号,并根据它包含的项目数添加容器b的相应个数的实例
            各种按钮状态的调节
        endif
    endproc

&&收料容器.prg
具体内容还没想好怎么写 。。。



2016-01-01 16:03
TonyDeng
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
等 级:贵宾
威 望:304
帖 子:25859
专家分:48889
注 册:2011-6-22
收藏
得分:0 
你參考一下我對MyGet容器類是怎麽用的:
程序代码:
#include "FoxPro.h"

SET DATE ANSI 
SET CENTURY ON 
IF Application.StartMode == 0
    SET PATH TO ADDBS(Application.ActiveProject.HomeDir) + "..\MyTools"
ENDIF 
SET PROCEDURE TO "MyForm" ADDITIVE 
SET PROCEDURE TO "MyGet" ADDITIVE 
SET PROCEDURE TO "MyGrid" ADDITIVE 
SET PATH TO ADDBS(Application.ActiveProject.HomeDir) + "Data" ADDITIVE 
Main()
CLOSE PROCEDURES
RETURN 

*-----------------------------
* 主程序入口
*-----------------------------
PROCEDURE Main()
    LOCAL loForm1
    
    PUBLIC gcBill_ID
    gcBill_ID = "0123456789ABCDEFGH"
    
    loForm1 = CREATEOBJECT("C_Form1")
    WITH loForm1
        .WindowState = WINDOWSTATE_MAXIMIZED
        .Show
    ENDWITH 
    READ EVENTS
    
ENDPROC 

*-----------------------------
* 收料單窗體類定義
*-----------------------------
DEFINE CLASS C_Form1 AS MyForm
    ShowWindow = 2
    Caption = "收料單"
    MinWidth = 1000
    MinHeight = 800
    
    ADD OBJECT Label1      AS Label        WITH Caption = "收  料  單", FontSize = 30, FontName = "隶书", AutoSize = .T., Top = 30
    ADD OBJECT Check1      AS CheckBox     WITH Caption = "將新列表項添加到相應表", AutoSize = .T.
    ADD OBJECT BillID      AS myGet
    ADD OBJECT Line1       AS Line         WITH Height = 0, BorderWidth = 2
    ADD OBJECT Provision   AS MyGet
    ADD OBJECT ProcessDate AS MyGet        WITH TabIndex = 1
    ADD OBJECT Line2       AS Line         WITH Height = 0, BorderWidth = 1
    ADD OBJECT Grid1       AS MyGrid       WITH RecordMark = .F., GridLines = 0, ScrollBars = 0
    ADD OBJECT Commands    AS CommandGroup
    
    PROCEDURE Load
        OPEN DATABASE "物料庫"
        IF !USED("收料表")
            USE "收料表" IN 0
        ENDIF 
    ENDPROC 
    
    PROCEDURE Unload
        USE IN "收料表"
        SET DATABASE TO "物料庫"
        CLOSE DATABASES
    ENDPROC 
    
    *-------------------------
    * 排列控件
    *-------------------------
    PROCEDURE Arrange
    
        DODEFAULT()

        WITH This.Label1
            .Left = (This.Width - .Width) / 2
        ENDWITH 
        
        WITH This.Check1
            .Top = This.Label1.Top + This.Label1.Height + 5
            .Left = 20
        ENDWITH 
        
        WITH This.BillID
            .Top = This.Check1.Top
            .Left = This.Width - .Width - 20
            gcBill_ID = "test"
        ENDWITH 
        
        WITH This.Line1
            .Top = This.BillID.Top + This.BillID.Height + 5
            .Left = 10
            .Width = This.Width - .Left - 10
        ENDWITH 
        
        WITH This.Provision
            .Top = This.Line1.Top + This.Line1.Height + 5
            .Left = 20
        ENDWITH 
        
        WITH This.ProcessDate
            .Top = This.Provision.Top
            .Left = This.Width - .Width - 20
        ENDWITH 
        
        WITH This.Line2
            .Top = This.Provision.Top + This.Provision.Height + 5
            .Left = 10
            .Width = This.Width - .Left - 10
        ENDWITH 
        
        WITH Top = This.Height - .Height - 5
            .Left = This.Width - .Width - 20
        ENDWITH 
        WITH This.Grid1
            .Top = This.Line2.Top + This.Line2.Height + 5
            .Left = 20
            .Height = Top - .Top - 5
            .Width = This.Width - .Left - 20
        ENDWITH 
        
    ENDPROC 
    
    *-------------------------
    * 初始化帳單號編輯框
    *-------------------------
    PROCEDURE BillID.Init
        WITH This
            .AddObject("Label1", "Label")
            WITH .Label1
                .Caption = "帳單號:"
                .AutoSize = .T.
            ENDWITH 
            .AddObject("Text1", "TextBox")
            WITH .Text1
                .ControlSource = "gcBill_ID"
                .Width = 200
                .Enabled = .F.
            ENDWITH 
            .SetAll("Visible", .T.)
        ENDWITH 
    ENDPROC 
    
    *-------------------------
    * 初始化供應單位編輯框
    *-------------------------
    PROCEDURE Provision.Init
        WITH This
            .AddObject("Label1", "Label")
            WITH .Label1
                .Caption = "供應單位:"
                .AutoSize = .T.
            ENDWITH 
            .AddObject("Combo1", "ComboBox")
            .Combo1.Width = 300
            .SetAll("Visible", .T.)
        ENDWITH 
    ENDPROC 
    
    *-------------------------
    * 初始化收料日期編輯框
    *-------------------------
    PROCEDURE ProcessDate.Init
        WITH This
            .AddObject("Label1", "Label")
            WITH .Label1
                .Caption = "收料日期:"
                .AutoSize = .T.
            ENDWITH 
            .AddObject("Text1", "TextBox")
            WITH .Text1
                .Value = DATE()
                .Width = 200
            ENDWITH 
            .SetAll("Visible", .T.)
        ENDWITH 
    ENDPROC 
    
    *-------------------------
    * 初始化收料輸入表格
    *-------------------------
    PROCEDURE Grid1.Init
        
        LOCAL laColumns[10,5]
        laColumns[ 1,1] = "材料分類"
        laColumns[ 1,2] = "收料表.材料分類"
        laColumns[ 1,3] = 80
        laColumns[ 2,1] = "名稱型號"
        laColumns[ 2,2] = ""
        laColumns[ 2,3] = 120
        laColumns[ 3,1] = "計量單位"
        laColumns[ 3,2] = ""
        laColumns[ 3,3] = 80
        laColumns[ 4,1] = "實收數量"
        laColumns[ 4,2] = "收料表.實收數量"
        laColumns[ 4,3] = 80
        laColumns[ 4,4] = "9,999.99"
        laColumns[ 4,5] = "9,999.99"
        laColumns[ 5,1] = "購入單價"
        laColumns[ 5,2] = "收料表.購入單價"
        laColumns[ 5,3] = 80
        laColumns[ 5,4] = "9,999.99"
        laColumns[ 5,5] = "9,999.99"
        laColumns[ 6,1] = "購入金額"
        laColumns[ 6,2] = "ROUND(收料表.實收數量 * 收料表.購入單價, 2)"
        laColumns[ 6,3] = 80
        laColumns[ 6,4] = "9,999,999.99"
        laColumns[ 7,1] = "標準單價"
        laColumns[ 7,2] = "收料表.標準單價"
        laColumns[ 7,3] = 80
        laColumns[ 7,4] = "9,999.99"
        laColumns[ 7,5] = "9,999.99"
        laColumns[ 8,1] = "標準金額"
        laColumns[ 8,2] = "ROUND(收料表.實收數量 * 收料表.標準單價, 2)"
        laColumns[ 8,3] = 80
        laColumns[ 8,4] = "9,999,999.99"
        laColumns[ 9,1] = "差價"
        laColumns[ 9,2] = "ROUND(收料表.實收數量 * (收料表.標準單價 - 收料表.購入單價), 2)"
        laColumns[ 9,3] = 80
        laColumns[ 6,4] = "9,999,999.99"
        laColumns[10,1] = "保管地點"
        laColumns[10,2] = "收料表.保管地點"
        laColumns[10,3] = 80
        
        WITH This
            .Set_Columns(@laColumns, "收料表")
            .Columns(2).ReadOnly = .T.
            .Columns(3).ReadOnly = .T.
        ENDWITH 

    ENDPROC 
    
    *-------------------------
    * 初始化命令組
    *-------------------------
    PROCEDURE Commands.Init
        
        LOCAL laButtons[2]
        laButtons[1] = "添加[\<A]"
        laButtons[2] = "刪除[\<D]"
        
        LOCAL lnWidth, lnHeight, lnIndex
        lnWidth = 60
        lnHeight = 25
        WITH This
            .ButtonCount = ALEN(laButtons, 1)
            .Width = .ButtonCount * lnWidth
            .Height = lnHeight
            FOR lnIndex = 1 TO .ButtonCount
                WITH .Buttons(lnIndex)
                    .Caption = laButtons[lnIndex]
                    .Top = 0
                    .Left = (lnIndex - 1) * lnWidth
                    .Width = lnWidth
                    .Height = lnHeight
                ENDWITH 
            NEXT 
        ENDWITH 
        
    ENDPROC 
    
    *-------------------------
    * 命令嚮應
    *-------------------------
    PROCEDURE Commands.Click
        DO CASE 
            CASE This.Value == 1
                This.Parent.New_Record
        ENDCASE 
        This.Parent.Grid1.SetFocus
    ENDPROC 
    
    *-------------------------
    * 添加記錄
    *-------------------------
    PROCEDURE New_Record
        SELECT "收料表"
        APPEND BLANK
        REPLACE 收料表.收料日期 WITH DATE()
    ENDPROC 
    
ENDDEFINE 


這裏有3個MyGet類(容器類)實例對象,每個都是獨立的,而每個對象中的控件名稱都是Label1、Text1之類,無論你創建多少個實例對象,其控件名稱都一樣,而且它們互不相干。

授人以渔,不授人以鱼。
2016-01-01 16:11
不懂才问
Rank: 15Rank: 15Rank: 15Rank: 15Rank: 15
来 自:大草原
等 级:贵宾
威 望:29
帖 子:1503
专家分:6593
注 册:2010-7-5
收藏
得分:0 
SET PROCEDURE TO "MyGet" ADDITIVE
SET PROCEDURE TO "MyGrid" ADDITIVE

这两个   放上来    参考一下    谢谢

报告老师,我低头不是因为我在装低调,是你问的问题,我真的不会答,,,
2016-01-01 17:05
tlliqi
Rank: 19Rank: 19Rank: 19Rank: 19Rank: 19Rank: 19
等 级:贵宾
威 望:204
帖 子:15453
专家分:65956
注 册:2006-4-27
收藏
得分:1 
慢慢看一下
2016-01-01 17:34
TonyDeng
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
等 级:贵宾
威 望:304
帖 子:25859
专家分:48889
注 册:2011-6-22
收藏
得分:0 
以下是引用不懂才问在2016-1-1 17:05:34的发言:

SET PROCEDURE TO "MyGet" ADDITIVE
SET PROCEDURE TO "MyGrid" ADDITIVE

这两个   放上来    参考一下    谢谢

嘿嘿,你倒會謀取。

授人以渔,不授人以鱼。
2016-01-01 21:19
不懂才问
Rank: 15Rank: 15Rank: 15Rank: 15Rank: 15
来 自:大草原
等 级:贵宾
威 望:29
帖 子:1503
专家分:6593
注 册:2010-7-5
收藏
得分:0 
回复 5楼 TonyDeng
你这是打算活活急死我啊  大年初一  虽然是阳历   也不带你这样的啊   。。。

报告老师,我低头不是因为我在装低调,是你问的问题,我真的不会答,,,
2016-01-01 22:53
吹水佬
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
等 级:版主
威 望:451
帖 子:10607
专家分:43186
注 册:2014-5-20
收藏
得分:1 
以下是引用不懂才问在2016-1-1 22:53:43的发言:

你这是打算活活急死我啊  大年初一  虽然是阳历   也不带你这样的啊   。。。

中毒不浅
2016-01-01 23:17
TonyDeng
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
等 级:贵宾
威 望:304
帖 子:25859
专家分:48889
注 册:2011-6-22
收藏
得分:0 
以下是引用不懂才问在2016-1-1 22:53:43的发言:

你这是打算活活急死我啊  大年初一  虽然是阳历   也不带你这样的啊   。。。

迟点吧

授人以渔,不授人以鱼。
2016-01-02 11:41
不懂才问
Rank: 15Rank: 15Rank: 15Rank: 15Rank: 15
来 自:大草原
等 级:贵宾
威 望:29
帖 子:1503
专家分:6593
注 册:2010-7-5
收藏
得分:0 
DEFINE CLASS m1Form as myForm
    showWindow=2
    caption="功能1——收料单"
    autoCenter=.t.
    windowType=1
    height=192
    width=540
    minWidth=this.Width
    minHeight=this.Height
    aspect=this.width/this.height        
    beforeWidth=this.width
    beforeHeight=this.Height
    formZoom=1
    currLine=1
    newLineTop=1    &&用于定义新容器的两个属性
    lastLineBottom=1

    ADD OBJECT howManyLine as spinner WITH spinnerHighValue=4,spinnerLowValue=1,value=1
    ADD OBJECT line3 as line WITH borderWidth=1,height=0
    ADD OBJECT line4 as line WITH borderWidth=1,height=0

    PROCEDURE Arrange
        WITH this.howManyLine
            .top=this.titleLabel.top+this.titleLabel.height/2-.height/2
            .left=this.howLineLabel.left+this.howLineLabel.width+3*this.formZoom
            .height=20*this.formZoom
            .width=.height*1.6
            .fontSize=this.howLineLabel.fontSize
        ENDWITH
        WITH this.line3
            .top=this.clflTitle.top+this.clflTitle.height+3*this.formZoom
            .left=12
            .width=this.width-.left*2
        ENDWITH        
        IF this.howManyLine.value==1
            this.newLineTop=this.line3.top+this.line3.borderWidth+3*this.formZoom
            thisform.lastLineBottom=thisform.newLineTop
        ENDIF
        WITH this.line4
            .top=thisform.lastLineBottom
            .left=12
            .width=this.width-.left*2
        ENDWITH
    PROCEDURE howManyLine.upClick &&rtnMainBtn.click
        IF thisform.currLine<4
                newLine="clmx"+ALLTRIM(STR(thisform.howManyLine.value))
                thisform.addobject('&newLine','shouliaoAddLine',;
                    thisform.bgddTitle.left+thisform.bgddTitle.width-thisform.clflTitle.left)
                WITH thisform.&newLine
                    .top=thisform.newLineTop
                    .left=thisform.clflTitle.left
                ENDWITH
            Thisform.Arrange
            thisform.newLineTop=thisform.&newLine..top+thisform.&newLine..height+3*thisform.formZoom
            thisform.lastLineBottom=thisform.newLineTop
        ELSE
            MESSAGEBOX("1单内最多只能有4项材料入账",64,"操作提示!")        
        ENDIF
    ENDPROC
enddefine
++++++++++++++++++++++
&&shouliaoContainer.prg

DEFINE CLASS shouliaoAddLine as Container
    backStyle=0
    borderWidth=0
    height=24
    myZoom=1
    aspect=this.width/this.height
    beforeWidth=1
   
    ADD OBJECT clflCbx as comboBox
    ADD OBJECT clmcCbx as comboBox
    ADD OBJECT jldwCbx as comboBox
    ADD OBJECT ssslTxt as textBox
    ADD OBJECT grdjTxt as textBox
    ADD OBJECT grjeTxt as textBox
    ADD OBJECT bzdjTxt as textBox
    ADD OBJECT bzjeTxt as textBox
    ADD OBJECT cjTxt as textBox
    ADD OBJECT cjCauseTxt as textBox
    ADD OBJECT bgddCbx as comboBox
   
    PROCEDURE Arrange
   
        IF this.width<>this.beforeWidth
            this.height=this.width/this.aspect
        ENDIF
        IF this.height<>this.beforeHeight
            this.width=this.height*this.aspect
        ENDIF
        this.myZoom=this.height/this.minHeight
        this.beforeHeight=this.height
        this.beforeWidth=this.width
   
        WITH this.clflCbx
            .top=1
            .left=1
            .height=24*this.myZoom
            .width=50*this.myZoom
        ENDWITH
        WITH this.clmcCbx
            .top=this.clflCbx.top
            .left=this.clflCbx.left+this.clflCbx.width+this.myZoom*3
            .height=24*this.myZoom
            .width=78*this.myZoom
            .fontSize=this.clflCbx.fontSize
        ENDWITH
        WITH this.jldwCbx
            .top=this.clflCbx.top
            .left=this.clmcCbx.left+this.clmcCbx.width+this.myZoom*3
            .height=24*this.myZoom
            .width=48*this.myZoom
            .fontSize=this.clflCbx.fontSize
        ENDWITH
        WITH this.ssslTxt
            .top=this.clflCbx.top
            .left=this.jldwCbx.left+this.jldwCbx.width+this.myZoom*3
            .height=24*this.myZoom
            .width=26*this.myZoom
            .fontSize=this.clflCbx.fontSize
        ENDWITH
        WITH this.grdjTxt
            .top=this.clflCbx.top
            .left=this.ssslTxt.left+this.ssslTxt.width+this.myZoom*3
            .height=24*this.myZoom
            .width=26*this.myZoom
            .fontSize=this.clflCbx.fontSize
        ENDWITH
        WITH this.grjeTxt
            .top=this.clflCbx.top
            .left=this.grdjTxt.left+this.grdjTxt.width+this.myZoom*3
            .height=24*this.myZoom
            .width=26*this.myZoom
            .fontSize=this.clflCbx.fontSize
        ENDWITH
        WITH this.bzdjTxt
            .top=this.clflCbx.top
            .left=this.grjeTxt.left+this.grjeTxt.width+this.myZoom*3
            .height=24*this.myZoom
            .width=26*this.myZoom
            .fontSize=this.clflCbx.fontSize
        ENDWITH
        WITH this.bzjeTxt
            .top=this.clflCbx.top
            .left=this.bzdjTxt.left+this.bzdjTxt.width+this.myZoom*3
            .height=24*this.myZoom
            .width=26*this.myZoom
            .fontSize=this.clflCbx.fontSize
        ENDWITH
        WITH this.cjTxt
            .top=this.clflCbx.top
            .left=this.bzjeTxt.left+this.bzjeTxt.width+this.myZoom*3
            .height=24*this.myZoom
            .width=26*this.myZoom
            .fontSize=this.clflCbx.fontSize
        ENDWITH
        WITH this.cjyyTxt
            .top=this.clflCbx.top
            .left=this.cjTxt.left+this.cjTxt.width+this.myZoom*3
            .height=24*this.myZoom
            .width=107*this.myZoom
            .fontSize=this.clflCbx.fontSize
        ENDWITH
        WITH this.bgddCbx
            .top=this.clflCbx.top
            .left=this.cjyyTxt.left+this.cjyyTxt.width+this.myZoom*3
            .height=24*this.myZoom
            .width=48*this.myZoom
            .fontSize=this.clflCbx.fontSize
        ENDWITH
        
        this.Height=this.bgddCbx.top+this.bgddCbx.height
        this.Width=this.bgddCbx.left+this.bgddCbx.width
    ENDPROC
   
    PROCEDURE activate
        this.arrange
    ENDPROC
   
    PROCEDURE resize
        this.arrange
    ENDPROC      
ENDDEFINE

+++++++++++++++++++++++++++++++++++++++++++++++

一、上面红色字   我想在创建容器的时候   把它的宽传到它的INIT里  怎么做啊?

二、新添加的容器   怎么添加一个新方法?比较它自己的arrange,然后把下面那段With放进去

报告老师,我低头不是因为我在装低调,是你问的问题,我真的不会答,,,
2016-01-02 15:26
不懂才问
Rank: 15Rank: 15Rank: 15Rank: 15Rank: 15
来 自:大草原
等 级:贵宾
威 望:29
帖 子:1503
专家分:6593
注 册:2010-7-5
收藏
得分:0 
ADD OBJECT outContainer as Container WITH backStyle=0,borderWidth=0

        WITH this.outContainer
            .top=this.line3.top+this.line3.borderWidth+3*this.formZoom
            .left=this.clflTitle.left
            .width=this.bgddTitle.left+this.bgddTitle.width-.left
            .height=(24*this.formZoom+3*this.formZoom)*this.howManyLine.value-1
        ENDWITH

        WITH this.line4
            .top=this.outContainer.top+this.outContainer.height
            .left=12
            .width=this.width-.left*2
        ENDWITH

               newLine="clmx"+ALLTRIM(STR(thisform.howManyLine.value))
                thisform.outContainer.addobject('&newLine','shouliaoAddLine')
                WITH thisform.outContainer.&newLine
                    .top=thisform.outContainer.top
                    .left=thisform.outContainer.left
                    .SetAll("Visible", .T.)
                ENDWITH


大圈套小圈的定位方法,控件还是不显示  已经SetAll了   。。。

报告老师,我低头不是因为我在装低调,是你问的问题,我真的不会答,,,
2016-01-02 15:56
快速回复:还是改成容器吧,编程的时候好处理一点
数据加载中...
 
   



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

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