我定义的如下: Private _Connection As New SqlConnection("User id=sa;Pwd=ww;initial catalog=haiermanage;Data Source=localhost") Private _EstradeName As String = "A-1" Private _TestAddress As String = "黄岛中一" Private _WorkMan As String = "戴宁" Public Property Connection() As SqlConnection Get Return _Connection End Get Set(ByVal Value As SqlConnection) _Connection = Value End Set End Property Public Property EstradeName() As String Get Return _EstradeName End Get Set(ByVal Value As String) _EstradeName = Value End Set End Property Public Property TestAddress() As String Get Return _TestAddress End Get Set(ByVal Value As String) _TestAddress = Value End Set End Property Public Property WorkMan() As String Get Return _WorkMan End Get Set(ByVal Value As String) _WorkMan = Value End Set End Property 但是在属性框中看不到这些属性
public _Connection As New SqlConnection("User id=sa;Pwd=ww;initial catalog=haiermanage;Data Source=localhost")
you property must use the public type,that you can see.
{
get { return strConn; }
set { strConn = value; }
}
{
set
{
A=value;
}
get
{
return A;
}
}
Private _Connection As New SqlConnection("User id=sa;Pwd=ww;initial catalog=haiermanage;Data Source=localhost")
Private _EstradeName As String = "A-1"
Private _TestAddress As String = "黄岛中一"
Private _WorkMan As String = "戴宁"
Public Property Connection() As SqlConnection
Get
Return _Connection
End Get
Set(ByVal Value As SqlConnection)
_Connection = Value
End Set
End Property
Public Property EstradeName() As String
Get
Return _EstradeName
End Get
Set(ByVal Value As String)
_EstradeName = Value
End Set
End Property
Public Property TestAddress() As String
Get
Return _TestAddress
End Get
Set(ByVal Value As String)
_TestAddress = Value
End Set
End Property
Public Property WorkMan() As String
Get
Return _WorkMan
End Get
Set(ByVal Value As String)
_WorkMan = Value
End Set
End Property
但是在属性框中看不到这些属性