| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1102 人关注过本帖
标题:定义类中自定义属性除用类设计器外能否用命令吗?
只看楼主 加入收藏
sylknb
Rank: 4
等 级:贵宾
威 望:14
帖 子:1547
专家分:184
注 册:2006-6-3
结帖率:79.38%
收藏
已结贴  问题点数:20 回复次数:24 
定义类中自定义属性除用类设计器外能否用命令吗?
定义类中自定义属性除用类设计器外能否用命令吗?
搜索更多相关主题的帖子: 设计 
2011-10-27 10:06
TonyDeng
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
等 级:贵宾
威 望:304
帖 子:25859
专家分:48889
注 册:2011-6-22
收藏
得分:5 
能~

授人以渔,不授人以鱼。
2011-10-27 15:39
cnfarer
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:179
帖 子:3330
专家分:21157
注 册:2010-1-19
收藏
得分:5 
几乎所有的东西都是用代码来实现的.

★★★★★为人民服务★★★★★
2011-10-27 15:45
panpende
Rank: 8Rank: 8
等 级:蝙蝠侠
威 望:4
帖 子:528
专家分:963
注 册:2009-4-27
收藏
得分:5 
请教TonyDeng老师和cnfarer老师,能否给一个示例程序,用代码来实现一个表单,添加一个表格,并且对表格的 CULUMN1.TEXT1 的 CLICK方法、DBLCLICK方法、INTERACTIVECHANGE方法等按要求进行设定。我没有成功,不知道为什么。
2011-10-28 08:03
cnfarer
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:179
帖 子:3330
专家分:21157
注 册:2010-1-19
收藏
得分:0 
回复 4楼 panpende
不用给示例,自己做下试试吧:用类设计器来做设计一个表单派生类 ,添加自定义属性,再用类浏览器就可以查看到代码了,这些代码就是你所要的.

★★★★★为人民服务★★★★★
2011-10-28 08:18
panpende
Rank: 8Rank: 8
等 级:蝙蝠侠
威 望:4
帖 子:528
专家分:963
注 册:2009-4-27
收藏
得分:0 
我编辑一个做好的表单,用类浏览器查看,看不到需要的代码。请老师用代码来给个示例程序吧。
2011-10-28 09:11
sylknb
Rank: 4
等 级:贵宾
威 望:14
帖 子:1547
专家分:184
注 册:2006-6-3
收藏
得分:0 
打开做好的表单类,步骤如下。第3步图中有一个向上黑三角(提示代码查看)点击就出来了所有的代码
1。图
图片附件: 游客没有浏览图片的权限,请 登录注册

2.
图片附件: 游客没有浏览图片的权限,请 登录注册

3
图片附件: 游客没有浏览图片的权限,请 登录注册

4
图片附件: 游客没有浏览图片的权限,请 登录注册
2011-10-28 09:22
TonyDeng
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
等 级:贵宾
威 望:304
帖 子:25859
专家分:48889
注 册:2011-6-22
收藏
得分:0 
达到目的了没有?

授人以渔,不授人以鱼。
2011-10-28 09:35
panpende
Rank: 8Rank: 8
等 级:蝙蝠侠
威 望:4
帖 子:528
专家分:963
注 册:2009-4-27
收藏
得分:0 
非常谢谢TonyDeng老师,看到代码了。
2011-10-28 11:16
panpende
Rank: 8Rank: 8
等 级:蝙蝠侠
威 望:4
帖 子:528
专家分:963
注 册:2009-4-27
收藏
得分:0 
**************************************************
*-- 类:           bg (d:\gy7\bga.vcx)
*-- 父类:  grid
*-- 基类:    grid
*-- 时间戳:   09/06/09 09:25:05 AM
*
DEFINE CLASS bg AS grid


    ColumnCount = 20
    FontSize = 10
    Height = 108
    RowHeight = 18
    Width = 192
    BackColor = RGB(240,255,240)
    HighlightBackColor = RGB(220,240,220)
    SelectedItemBackColor = RGB(220,220,250)
    HighlightStyle = 1
    Name = "bg"
    Column1.FontSize = 10
    Column1.Width = 55
    Column1.BackColor = RGB(240,255,240)
    Column1.Name = "Column1"
    Column2.FontSize = 10
    Column2.Width = 55
    Column2.BackColor = RGB(240,255,240)
    Column2.Name = "Column2"
    Column3.FontSize = 10
    Column3.Width = 55
    Column3.BackColor = RGB(240,255,240)
    Column3.Name = "Column3"
    Column4.FontSize = 10
    Column4.Width = 55
    Column4.BackColor = RGB(240,255,240)
    Column4.Name = "Column4"
    Column5.FontSize = 10
    Column5.Width = 55
    Column5.BackColor = RGB(240,255,240)
    Column5.Name = "Column5"
    Column6.FontSize = 10
    Column6.Width = 55
    Column6.BackColor = RGB(240,255,240)
    Column6.Name = "Column6"
    Column7.FontSize = 10
    Column7.Width = 55
    Column7.BackColor = RGB(240,255,240)
    Column7.Name = "Column7"
    Column8.FontSize = 10
    Column8.Width = 55
    Column8.BackColor = RGB(240,255,240)
    Column8.Name = "Column8"
    Column9.FontSize = 10
    Column9.Width = 55
    Column9.BackColor = RGB(240,255,240)
    Column9.Name = "Column9"
    Column10.FontSize = 10
    Column10.Width = 55
    Column10.BackColor = RGB(240,255,240)
    Column10.Name = "Column10"
    Column11.FontSize = 10
    Column11.Width = 55
    Column11.BackColor = RGB(240,255,240)
    Column11.Name = "Column11"
    Column12.FontSize = 10
    Column12.Width = 55
    Column12.BackColor = RGB(240,255,240)
    Column12.Name = "Column12"
    Column13.FontSize = 10
    Column13.Width = 55
    Column13.BackColor = RGB(240,255,240)
    Column13.Name = "Column13"
    Column14.FontSize = 10
    Column14.Width = 55
    Column14.BackColor = RGB(240,255,240)
    Column14.Name = "Column14"
    Column15.FontSize = 10
    Column15.Width = 55
    Column15.BackColor = RGB(240,255,240)
    Column15.Name = "Column15"
    Column16.FontSize = 10
    Column16.Width = 55
    Column16.BackColor = RGB(240,255,240)
    Column16.Name = "Column16"
    Column17.FontSize = 10
    Column17.Width = 55
    Column17.BackColor = RGB(240,255,240)
    Column17.Name = "Column17"
    Column18.FontSize = 10
    Column18.Width = 55
    Column18.BackColor = RGB(240,255,240)
    Column18.Name = "Column18"
    Column19.FontSize = 10
    Column19.Width = 55
    Column19.BackColor = RGB(240,255,240)
    Column19.Name = "Column19"
    Column20.FontSize = 10
    Column20.Width = 55
    Column20.BackColor = RGB(240,255,240)
    Column20.Name = "Column20"


    ADD OBJECT bg.column1.header1 AS header WITH ;
        FontSize = 10, ;
        Alignment = 2, ;
        Caption = "Header1", ;
        Name = "Header1"


    ADD OBJECT bg.column1.text1 AS textbox WITH ;
        FontSize = 10, ;
        BorderStyle = 0, ;
        Margin = 0, ;
        ForeColor = RGB(0,0,0), ;
        BackColor = RGB(240,255,240), ;
        SelectedBackColor = RGB(220,220,250), ;
        Name = "Text1"


    ADD OBJECT bg.column2.header1 AS header WITH ;
        FontSize = 10, ;
        Alignment = 2, ;
        Caption = "Header1", ;
        Name = "Header1"


    ADD OBJECT bg.column2.text1 AS textbox WITH ;
        FontSize = 10, ;
        BorderStyle = 0, ;
        Margin = 0, ;
        ForeColor = RGB(0,0,0), ;
        BackColor = RGB(240,255,240), ;
        SelectedBackColor = RGB(220,220,250), ;
        Name = "Text1"


    ADD OBJECT bg.column3.header1 AS header WITH ;
        FontSize = 10, ;
        Alignment = 2, ;
        Caption = "Header1", ;
        Name = "Header1"


    ADD OBJECT bg.column3.text1 AS textbox WITH ;
        FontSize = 10, ;
        BorderStyle = 0, ;
        Margin = 0, ;
        ForeColor = RGB(0,0,0), ;
        BackColor = RGB(240,255,240), ;
        SelectedBackColor = RGB(220,220,250), ;
        Name = "Text1"


    ADD OBJECT bg.column4.header1 AS header WITH ;
        FontSize = 10, ;
        Alignment = 2, ;
        Caption = "Header1", ;
        Name = "Header1"


    ADD OBJECT bg.column4.text1 AS textbox WITH ;
        FontSize = 10, ;
        BorderStyle = 0, ;
        Margin = 0, ;
        ForeColor = RGB(0,0,0), ;
        BackColor = RGB(240,255,240), ;
        SelectedBackColor = RGB(220,220,250), ;
        Name = "Text1"


    ADD OBJECT bg.column5.header1 AS header WITH ;
        FontSize = 10, ;
        Alignment = 2, ;
        Caption = "Header1", ;
        Name = "Header1"


    ADD OBJECT bg.column5.text1 AS textbox WITH ;
        FontSize = 10, ;
        BorderStyle = 0, ;
        Margin = 0, ;
        ForeColor = RGB(0,0,0), ;
        BackColor = RGB(240,255,240), ;
        SelectedBackColor = RGB(220,220,250), ;
        Name = "Text1"


    ADD OBJECT bg.column6.header1 AS header WITH ;
        FontSize = 10, ;
        Alignment = 2, ;
        Caption = "Header1", ;
        Name = "Header1"


    ADD OBJECT bg.column6.text1 AS textbox WITH ;
        FontSize = 10, ;
        BorderStyle = 0, ;
        Margin = 0, ;
        ForeColor = RGB(0,0,0), ;
        BackColor = RGB(240,255,240), ;
        SelectedBackColor = RGB(220,220,250), ;
        Name = "Text1"


    ADD OBJECT bg.column7.header1 AS header WITH ;
        FontSize = 10, ;
        Alignment = 2, ;
        Caption = "Header1", ;
        Name = "Header1"


    ADD OBJECT bg.column7.text1 AS textbox WITH ;
        FontSize = 10, ;
        BorderStyle = 0, ;
        Margin = 0, ;
        ForeColor = RGB(0,0,0), ;
        BackColor = RGB(240,255,240), ;
        SelectedBackColor = RGB(220,220,250), ;
        Name = "Text1"


    ADD OBJECT bg.column8.header1 AS header WITH ;
        FontSize = 10, ;
        Alignment = 2, ;
        Caption = "Header1", ;
        Name = "Header1"


    ADD OBJECT bg.column8.text1 AS textbox WITH ;
        FontSize = 10, ;
        BorderStyle = 0, ;
        Margin = 0, ;
        ForeColor = RGB(0,0,0), ;
        BackColor = RGB(240,255,240), ;
        SelectedBackColor = RGB(220,220,250), ;
        Name = "Text1"


    ADD OBJECT bg.column9.header1 AS header WITH ;
        FontSize = 10, ;
        Alignment = 2, ;
        Caption = "Header1", ;
        Name = "Header1"


    ADD OBJECT bg.column9.text1 AS textbox WITH ;
        FontSize = 10, ;
        BorderStyle = 0, ;
        Margin = 0, ;
        ForeColor = RGB(0,0,0), ;
        BackColor = RGB(240,255,240), ;
        SelectedBackColor = RGB(220,220,250), ;
        Name = "Text1"


    ADD OBJECT bg.column10.header1 AS header WITH ;
        FontSize = 10, ;
        Alignment = 2, ;
        Caption = "Header1", ;
        Name = "Header1"


    ADD OBJECT bg.column10.text1 AS textbox WITH ;
        FontSize = 10, ;
        BorderStyle = 0, ;
        Margin = 0, ;
        ForeColor = RGB(0,0,0), ;
        BackColor = RGB(240,255,240), ;
        SelectedBackColor = RGB(220,220,250), ;
        Name = "Text1"


    ADD OBJECT bg.column11.header1 AS header WITH ;
        FontSize = 10, ;
        Alignment = 2, ;
        Caption = "Header1", ;
        Name = "Header1"


    ADD OBJECT bg.column11.text1 AS textbox WITH ;
        FontSize = 10, ;
        BorderStyle = 0, ;
        Margin = 0, ;
        ForeColor = RGB(0,0,0), ;
        BackColor = RGB(240,255,240), ;
        SelectedBackColor = RGB(220,220,250), ;
        Name = "Text1"


    ADD OBJECT bg.column12.header1 AS header WITH ;
        FontSize = 10, ;
        Alignment = 2, ;
        Caption = "Header1", ;
        Name = "Header1"


    ADD OBJECT bg.column12.text1 AS textbox WITH ;
        FontSize = 10, ;
        BorderStyle = 0, ;
        Margin = 0, ;
        ForeColor = RGB(0,0,0), ;
        BackColor = RGB(240,255,240), ;
        SelectedBackColor = RGB(220,220,250), ;
        Name = "Text1"


    ADD OBJECT bg.column13.header1 AS header WITH ;
        FontSize = 10, ;
        Alignment = 2, ;
        Caption = "Header1", ;
        Name = "Header1"


    ADD OBJECT bg.column13.text1 AS textbox WITH ;
        FontSize = 10, ;
        BorderStyle = 0, ;
        Margin = 0, ;
        ForeColor = RGB(0,0,0), ;
        BackColor = RGB(240,255,240), ;
        SelectedBackColor = RGB(220,220,250), ;
        Name = "Text1"


    ADD OBJECT bg.column14.header1 AS header WITH ;
        FontSize = 10, ;
        Alignment = 2, ;
        Caption = "Header1", ;
        Name = "Header1"


    ADD OBJECT bg.column14.text1 AS textbox WITH ;
        FontSize = 10, ;
        BorderStyle = 0, ;
        Margin = 0, ;
        ForeColor = RGB(0,0,0), ;
        BackColor = RGB(240,255,240), ;
        SelectedBackColor = RGB(220,220,250), ;
        Name = "Text1"


    ADD OBJECT bg.column15.header1 AS header WITH ;
        FontSize = 10, ;
        Alignment = 2, ;
        Caption = "Header1", ;
        Name = "Header1"


    ADD OBJECT bg.column15.text1 AS textbox WITH ;
        FontSize = 10, ;
        BorderStyle = 0, ;
        Margin = 0, ;
        ForeColor = RGB(0,0,0), ;
        BackColor = RGB(240,255,240), ;
        SelectedBackColor = RGB(220,220,250), ;
        Name = "Text1"


    ADD OBJECT bg.column16.header1 AS header WITH ;
        FontSize = 10, ;
        Alignment = 2, ;
        Caption = "Header1", ;
        Name = "Header1"


    ADD OBJECT bg.column16.text1 AS textbox WITH ;
        FontSize = 10, ;
        BorderStyle = 0, ;
        Margin = 0, ;
        ForeColor = RGB(0,0,0), ;
        BackColor = RGB(240,255,240), ;
        SelectedBackColor = RGB(220,220,250), ;
        Name = "Text1"


    ADD OBJECT bg.column17.header1 AS header WITH ;
        FontSize = 10, ;
        Alignment = 2, ;
        Caption = "Header1", ;
        Name = "Header1"


    ADD OBJECT bg.column17.text1 AS textbox WITH ;
        FontSize = 10, ;
        BorderStyle = 0, ;
        Margin = 0, ;
        ForeColor = RGB(0,0,0), ;
        BackColor = RGB(240,255,240), ;
        SelectedBackColor = RGB(220,220,250), ;
        Name = "Text1"


    ADD OBJECT bg.column18.header1 AS header WITH ;
        FontSize = 10, ;
        Alignment = 2, ;
        Caption = "Header1", ;
        Name = "Header1"


    ADD OBJECT bg.column18.text1 AS textbox WITH ;
        FontSize = 10, ;
        BorderStyle = 0, ;
        Margin = 0, ;
        ForeColor = RGB(0,0,0), ;
        BackColor = RGB(240,255,240), ;
        SelectedBackColor = RGB(220,220,250), ;
        Name = "Text1"


    ADD OBJECT bg.column19.header1 AS header WITH ;
        FontSize = 10, ;
        Alignment = 2, ;
        Caption = "Header1", ;
        Name = "Header1"


    ADD OBJECT bg.column19.text1 AS textbox WITH ;
        FontSize = 10, ;
        BorderStyle = 0, ;
        Margin = 0, ;
        ForeColor = RGB(0,0,0), ;
        BackColor = RGB(240,255,240), ;
        SelectedBackColor = RGB(220,220,250), ;
        Name = "Text1"


    ADD OBJECT bg.column20.header1 AS header WITH ;
        FontSize = 10, ;
        Alignment = 2, ;
        Caption = "Header1", ;
        Name = "Header1"


    ADD OBJECT bg.column20.text1 AS textbox WITH ;
        FontSize = 10, ;
        BorderStyle = 0, ;
        Margin = 0, ;
        ForeColor = RGB(0,0,0), ;
        BackColor = RGB(240,255,240), ;
        SelectedBackColor = RGB(220,220,250), ;
        Name = "Text1"


    PROCEDURE text1.DblClick
        DO Z40
    ENDPROC


    PROCEDURE text1.DblClick
        DO Z40
    ENDPROC


    PROCEDURE text1.DblClick
        DO Z40
    ENDPROC


    PROCEDURE text1.DblClick
        DO Z40
    ENDPROC


    PROCEDURE text1.DblClick
        DO Z40
    ENDPROC


    PROCEDURE text1.DblClick
        DO Z40
    ENDPROC


    PROCEDURE text1.DblClick
        DO Z40
    ENDPROC


    PROCEDURE text1.DblClick
        DO Z40
    ENDPROC


    PROCEDURE text1.DblClick
        DO Z40
    ENDPROC


    PROCEDURE text1.DblClick
        DO Z40
    ENDPROC


    PROCEDURE text1.DblClick
        DO Z40
    ENDPROC


    PROCEDURE text1.DblClick
        DO Z40
    ENDPROC


    PROCEDURE text1.DblClick
        DO Z40
    ENDPROC


    PROCEDURE text1.DblClick
        DO Z40
    ENDPROC


    PROCEDURE text1.DblClick
        DO Z40
    ENDPROC


    PROCEDURE text1.DblClick
        DO Z40
    ENDPROC


    PROCEDURE text1.DblClick
        DO Z40
    ENDPROC


    PROCEDURE text1.DblClick
        DO Z40
    ENDPROC


    PROCEDURE text1.DblClick
        DO Z40
    ENDPROC


    PROCEDURE text1.DblClick
        DO Z40
    ENDPROC


ENDDEFINE
*
*-- EndDefine: bg
**************************************************



我的一个疑问是:

PROCEDURE text1.DblClick
   DO Z40
ENDPROC

如果我对CULUMN1,CULUMN2,CULUMN3,CULUMN4,....各个TEXT1的 DBLCLICK 配置不同的程序是否可以?当然在此例子中,我是统一 DO Z40 .



2011-10-28 11:26
快速回复:定义类中自定义属性除用类设计器外能否用命令吗?
数据加载中...
 
   



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

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