标题:如何在表单中这样隐藏表格?
只看楼主
qinling072
Rank: 1
等 级:新手上路
帖 子:10
专家分:0
注 册:2012-6-6
得分:0 
我把我的图片上传不到附件上面!!
2013-01-26 16:58
zxl931
Rank: 2
等 级:论坛游民
帖 子:31
专家分:42
注 册:2007-1-8
得分:3 
运行以下代码看看:
PUBLIC oform1
oform1=NEWOBJECT("form1")
oform1.Show
RETURN


DEFINE CLASS form1 AS form


    Top = 0
    Left = 0
    Height = 472
    Width = 576
    DoCreate = .T.
    Caption = "Form1"
    Name = "form1"


    ADD OBJECT check1 AS checkbox WITH ;
        Top = 24, ;
        Left = 24, ;
        Height = 25, ;
        Width = 73, ;
        Alignment = 0, ;
        Caption = "Check1", ;
        Name = "Check1"


    ADD OBJECT check2 AS checkbox WITH ;
        Top = 60, ;
        Left = 24, ;
        Height = 13, ;
        Width = 85, ;
        Alignment = 0, ;
        Caption = "Check2", ;
        Name = "Check2"


    ADD OBJECT text1 AS textbox WITH ;
        Height = 25, ;
        Left = 144, ;
        Top = 36, ;
        Width = 97, ;
        Name = "Text1"


    ADD OBJECT grid1 AS grid WITH ;
        ColumnCount = 1, ;
        Height = 312, ;
        Left = 24, ;
        Panel = 1, ;
        Top = 144, ;
        Width = 420, ;
        Name = "Grid1", ;
        Column1.Width = 192, ;
        Column1.Name = "Column1"


    ADD OBJECT command1 AS commandbutton WITH ;
        Top = 84, ;
        Left = 132, ;
        Height = 37, ;
        Width = 109, ;
        Caption = "Command1", ;
        Name = "Command1"


    ADD OBJECT container1 AS container WITH ;
        Top = 36, ;
        Left = 288, ;
        Width = 181, ;
        Height = 73, ;
        Name = "Container1"


    PROCEDURE hidegrid
        LPARAMETERS nButton, nShift, nXCoord, nYCoord
        thisform.grid1.Visible = !thisform.grid1.Visible
    ENDPROC


    PROCEDURE Init
        CREATE CURSOR kkk(序号 i)
        INSERT INTO kkk VALUES (1)
        INSERT INTO kkk VALUES (2)
        INSERT INTO kkk VALUES (3)
        GO TOP IN kkk
        thisform.grid1.RecordSource="kkk"
        thisform.grid1.coLUMN1.ControlSource="kkk.序号"


        FOR EACH loObj IN THISFORM.OBJECTS
            IF !LOWER(loObj.NAME) = "grid1"
                BINDEVENT(loObj,"mousedown",THISFORM,"hideGrid")
            ENDIF
        ENDFOR
        BINDEVENT(thisform,"mousedown",THISFORM,"hideGrid")
    ENDPROC


ENDDEFINE
*
*-- EndDefine: form1
**************************************************
2013-01-26 17:50
sdta
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
来 自:江苏省连云港市
等 级:版主
威 望:323
帖 子:9621
专家分:26174
注 册:2012-2-5
得分:0 
雨田大侠:请教个问题,见下图

问题:
1.当表格中的记录超过一个页面时,如何使数据表中的最后一条记录,固定在表格控件的最下方,这样就不显示表格的多余行了;同时让右侧多余的列不显示。
2.当表格控件中的数据不满一个页面时,如何能使滚动条不滚动,使第一条记录显示在表格控件可见部分的第一行。

坚守VFP最后的阵地
2013-01-26 18:13
sdta
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
来 自:江苏省连云港市
等 级:版主
威 望:323
帖 子:9621
专家分:26174
注 册:2012-2-5
得分:0 
看样子大侠又云游去了,不知何年能看到这个帖子。

坚守VFP最后的阵地
2013-01-26 18:20
qjbzjp
Rank: 13Rank: 13Rank: 13Rank: 13
来 自:尧的故乡
等 级:贵宾
威 望:48
帖 子:1914
专家分:4397
注 册:2007-3-14
得分:0 
以下是引用qinling072在2013-1-26 16:57:49的发言:

还有个问题,我在表格的CLICK事件中,加入了代码,如果在VALID事件中写上this.Visible = .f.,那我就不能选择表格中的数据了!!应该怎么解决?
那也好办,在表单的右击(或双击)事件中让表格visible=.t.

相互学习,互相交流,共同提高。
2013-01-26 22:23
zxl931
Rank: 2
等 级:论坛游民
帖 子:31
专家分:42
注 册:2007-1-8
得分:0 
回复 13楼 sdta
明白你的意思,我也注意到了,Grid控件就是存在这样的问题,目前还没有想到解决的办法。
2013-01-27 09:54
ycvf
Rank: 2
等 级:论坛游民
帖 子:209
专家分:56
注 册:2012-8-25
得分:3 
以下是引用zxl931在2013-1-26 17:50:13的发言:

运行以下代码看看:
PUBLIC oform1
oform1=NEWOBJECT("form1")
oform1.Show
RETURN


DEFINE CLASS form1 AS form


    Top = 0
    Left = 0
    Height = 472
    Width = 576
    DoCreate = .T.
    Caption = "Form1"
    Name = "form1"


    ADD OBJECT check1 AS checkbox WITH ;
        Top = 24, ;
        Left = 24, ;
        Height = 25, ;
        Width = 73, ;
        Alignment = 0, ;
        Caption = "Check1", ;
        Name = "Check1"


    ADD OBJECT check2 AS checkbox WITH ;
        Top = 60, ;
        Left = 24, ;
        Height = 13, ;
        Width = 85, ;
        Alignment = 0, ;
        Caption = "Check2", ;
        Name = "Check2"


    ADD OBJECT text1 AS textbox WITH ;
        Height = 25, ;
        Left = 144, ;
        Top = 36, ;
        Width = 97, ;
        Name = "Text1"


    ADD OBJECT grid1 AS grid WITH ;
        ColumnCount = 1, ;
        Height = 312, ;
        Left = 24, ;
        Panel = 1, ;
        Top = 144, ;
        Width = 420, ;
        Name = "Grid1", ;
        Column1.Width = 192, ;
        Column1.Name = "Column1"


    ADD OBJECT command1 AS commandbutton WITH ;
        Top = 84, ;
        Left = 132, ;
        Height = 37, ;
        Width = 109, ;
        Caption = "Command1", ;
        Name = "Command1"


    ADD OBJECT container1 AS container WITH ;
        Top = 36, ;
        Left = 288, ;
        Width = 181, ;
        Height = 73, ;
        Name = "Container1"


    PROCEDURE hidegrid
        LPARAMETERS nButton, nShift, nXCoord, nYCoord
        thisform.grid1.Visible = !thisform.grid1.Visible
    ENDPROC


    PROCEDURE Init
        CREATE CURSOR kkk(序号 i)
        INSERT INTO kkk VALUES (1)
        INSERT INTO kkk VALUES (2)
        INSERT INTO kkk VALUES (3)
        GO TOP IN kkk
        thisform.grid1.RecordSource="kkk"
        thisform.grid1.coLUMN1.ControlSource="kkk.序号"


        FOR EACH loObj IN THISFORM.OBJECTS
            IF !LOWER(loObj.NAME) = "grid1"
                BINDEVENT(loObj,"mousedown",THISFORM,"hideGrid")
            ENDIF
        ENDFOR
        BINDEVENT(thisform,"mousedown",THISFORM,"hideGrid")
    ENDPROC


ENDDEFINE
*
*-- EndDefine: form1
**************************************************
VF6.0下(XP)测试文件不存在,红色标注的

落花人独立,微雨燕双飞。
2013-01-29 18:08
wzxc
Rank: 9Rank: 9Rank: 9
来 自:齐鲁大地
等 级:贵宾
威 望:39
帖 子:985
专家分:1296
注 册:2006-4-25
得分:3 
VF6.0不支持 BINDEVENT

认真看书学习,弄通Fox主义。
2013-01-29 18:15
sdta
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
来 自:江苏省连云港市
等 级:版主
威 望:323
帖 子:9621
专家分:26174
注 册:2012-2-5
得分:3 
以下是引用zxl931在2013-1-27 09:54:14的发言:

明白你的意思,我也注意到了,Grid控件就是存在这样的问题,目前还没有想到解决的办法。
多谢大侠回复

坚守VFP最后的阵地
2013-01-29 19:02



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




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

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