以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  在全局代码,定义类属性时,属性标题描述如何定义  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=76333)

--  作者:cyl123
--  发布时间:2015/10/27 9:43:00
--  在全局代码,定义类属性时,属性标题描述如何定义
红色部分,在vb中添加引用“System.ComponentModel” 就可以使用了。在狐表中,怎么解决?
Imports System.ComponentModel
\'\'\'
<DefaultPropertyAttribute("Title")> _
Public Class SimpleProperties
    \'\'\'
    Private _Title As String
    Private _Show As Boolean
    Private _Number As Short
    \'\'\'
    <CategoryAttribute("Application"), _
       Browsable(True), _
       [ReadOnly](False), _
       BindableAttribute(False), _
       DefaultValueAttribute(""), _
       DesignOnly(False), _
       DescriptionAttribute("Enter Title for the application")> _
       Public Property Title() As String
           Get
               Return _Title
           End Get
           Set(ByVal Value As String)
               _Title = Value
           End Set
       End Property
    \'\'\'
    <CategoryAttribute("Application"), _
       Browsable(True), _
       [ReadOnly](False), _
       BindableAttribute(False), _
       DefaultValueAttribute("True"), _
       DesignOnly(False), _
       DescriptionAttribute("Show option")> _
       Public Property Show() As Boolean
           Get
               Return _Show
           End Get
           Set(ByVal Value As Boolean)
               _Show = Value
            End Set
       End Property
    \'\'\'
    <CategoryAttribute("Application"), _
       Browsable(True), _
       [ReadOnly](False), _
       BindableAttribute(False), _
       DefaultValueAttribute("0"), _
       DesignOnly(False), _
       DescriptionAttribute("Enter a number")> _
       Public Property Number() As Short
           Get
               Return _Number
           End Get
           Set(ByVal Value As Short)
               _Number = Value
           End Set
       End Property
    \'\'\'
End Class

--  作者:逛逛
--  发布时间:2015/10/27 9:47:00
--  

直接加啊

 

 

    \'\'\'
    <System.ComponentModel.CategoryAttribute("Application"), _
       System.ComponentModel.Browsable(True), _
       System.ComponentModel.[ReadOnly](False), _
       System.ComponentModel.BindableAttribute(False), _
       System.ComponentModel.DefaultValueAttribute(""), _
       System.ComponentModel.DesignOnly(False), _
       System.ComponentModel.DescriptionAttribute("Enter Title for the application")> _
       Public Property Title() As String
           Get
               Return _Title
           End Get
           Set(ByVal Value As String)
               _Title = Value
           End Set
       End Property
    \'\'\'
    <System.ComponentModel.CategoryAttribute("Application"), _
       System.ComponentModel.Browsable(True), _
       System.ComponentModel.[ReadOnly](False), _
       System.ComponentModel.BindableAttribute(False), _
       System.ComponentModel.DefaultValueAttribute("True"), _
       System.ComponentModel.DesignOnly(False), _
       System.ComponentModel.DescriptionAttribute("Show option")> _
       Public Property Show() As Boolean
           Get
               Return _Show
           End Get
           Set(ByVal Value As Boolean)
               _Show = Value
            End Set
       End Property
    \'\'\'
    <System.ComponentModel.CategoryAttribute("Application"), _
       System.ComponentModel.Browsable(True), _
       System.ComponentModel.[ReadOnly](False), _
       System.ComponentModel.BindableAttribute(False), _
       System.ComponentModel.DefaultValueAttribute("0"), _
       System.ComponentModel.DesignOnly(False), _
      System.ComponentModel.DescriptionAttribute("Enter a number")> _
       Public Property Number() As Short
           Get
               Return _Number
           End Get
           Set(ByVal Value As Short)
               _Number = Value
           End Set
       End Property
    \'\'\'
End Class


--  作者:大红袍
--  发布时间:2015/10/27 9:50:00
--  
<System.ComponentModel.DefaultPropertyAttribute("Title")> _
Public Class SimpleProperties
    \'\'\'
    Private _Title As String
    Private _Show As Boolean
    Private _Number As Short
    \'\'\'
    <System.ComponentModel.CategoryAttribute("Application"), _
       System.ComponentModel.Browsable(True), _
       System.ComponentModel.[ReadOnly](False), _
       System.ComponentModel.BindableAttribute(False), _
       System.ComponentModel.DefaultValueAttribute(""), _
       System.ComponentModel.DesignOnly(False), _
       System.ComponentModel.DescriptionAttribute("Enter Title for the application")> _
       Public Property Title() As String
           Get
               Return _Title
           End Get
           Set(ByVal Value As String)
               _Title = Value
           End Set
       End Property
    \'\'\'
    <System.ComponentModel.CategoryAttribute("Application"), _
       System.ComponentModel.Browsable(True), _
       System.ComponentModel.[ReadOnly](False), _
       System.ComponentModel.BindableAttribute(False), _
       System.ComponentModel.DefaultValueAttribute("True"), _
       System.ComponentModel.DesignOnly(False), _
       System.ComponentModel.DescriptionAttribute("Show option")> _
       Public Property Show() As Boolean
           Get
               Return _Show
           End Get
           Set(ByVal Value As Boolean)
               _Show = Value
            End Set
       End Property
    \'\'\'
    <System.ComponentModel.CategoryAttribute("Application"), _
       System.ComponentModel.Browsable(True), _
       System.ComponentModel.[ReadOnly](False), _
       System.ComponentModel.BindableAttribute(False), _
       System.ComponentModel.DefaultValueAttribute("0"), _
       System.ComponentModel.DesignOnly(False), _
       System.ComponentModel.DescriptionAttribute("Enter a number")> _
       Public Property Number() As Short
           Get
               Return _Number
           End Get
           Set(ByVal Value As Short)
               _Number = Value
           End Set
       End Property
    \'\'\'
End Class

--  作者:cyl123
--  发布时间:2015/10/27 10:04:00
--  
大红袍老师,是否一定要在全局代码中定义类?能否通过函数实现?全局代码调试太麻烦了。
--  作者:大红袍
--  发布时间:2015/10/27 10:10:00
--  
必须写到全局代码那里。
--  作者:cyl123
--  发布时间:2015/10/27 10:11:00
--  
噢噢,还有个问题,如何将属性值绑定到数据表?
--  作者:piner
--  发布时间:2015/10/27 10:30:00
--  
帮助文件说,每个表每个列都是对象,本身就设置了一些属性和方法、事情等

其实,很多人也想自己通过添加一些类的形式加入自己的类等等
希望能够实现

--  作者:cyl123
--  发布时间:2015/10/27 10:49:00
--  
大红袍老师,如何将属性值绑定到数据表?
--  作者:逛逛
--  发布时间:2015/10/27 11:13:00
--  

这个狐表的表控件帮不了,只有用原生的C1表格帮定,代码量会很大。

 

楼主还是直接用数据表吧。