首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > VB Dotnet >

蛇年万事大吉!Public Property Name As String = "kkk" & [color=#FF0000]nf.

2013-02-19 
蛇年万事如意!!!Public Property Name As String kkk & [color#FF0000]nf.Users.Count[Public Proper

蛇年万事如意!!!Public Property Name As String = "kkk" & [color=#FF0000]nf.Users.Count[

Public Property Name As String = "kkk" & nf.Users.Count提示不对,我想取得该如何做,谢谢!!!


Imports System.ComponentModel.Design
Imports System.ComponentModel
Imports System.Windows.Forms.Design
Imports System.Drawing.Design
Imports System.Drawing.Drawing2D
Imports System.Text

<Serializable()> _
<Designer(GetType(mytable))> _
Public Class Table
    Inherits Control
       Private _users As List(Of User) = Nothing
    '  Public hgf As Short = Users.Count
    <TypeConverter("ExpandableObjectConverter")>
    Public Class User
        Private nf As Table
        '  <NotifyParentProperty(True)>
        Public Property ID As Integer = 0
        '   <NotifyParentProperty(True)>
        '   Public Property Name As String = String.Empty

        Public Property x1 As Single
        Public Property x2 As Single
        <NotifyParentProperty(True)>
        Public Property Name As String = "kkk" & nf.Users.Count  'String.Empty
        Public Property Name1() As bleCelll

        Public Structure bleCelll
            '  Dim NEWtableCellBj As UserEnum
            Dim x1 As Single
            Dim x2 As Single
            Dim Name As String
            Dim cellcor As Color

        End Structure

    End Class

    <DesignerSerializationVisibility(DesignerSerializationVisibility.Content)>
    <TypeConverter("CollectionConverter")>
    Public ReadOnly Property Users As List(Of User)
        Get
            If (_users Is Nothing) Then
                _users = New List(Of User)
            End If
            Return _users
        End Get
    End Property

End Class

------解决方案--------------------


在定义成员变量的时候赋初值不要使用属性访问器,你可以写在构造函数中。

热点排行