读书人

蛇年万事大吉!Public Property Name A

发布时间: 2013-02-19 11:11:40 作者: rapoo

蛇年万事如意!!!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

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


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

读书人网 >VB Dotnet

热点推荐