2010-12-29 2 views
1

이 새로운디자이너에서 상속 된 속성을 편집 할 수 없습니다.

Public Class BaseForm 

    Private _HappyTime As Boolean 

    Public Property HappyTime() As Boolean 
     Get 
      Return _HappyTime 
     End Get 
     Set(ByVal value As Boolean) 
      _HappyTime = Value 
     End Set 
    End Property 

End Class 

<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ 
Partial Class BaseForm 
    Inherits System.Windows.Forms.Form 

    <System.Diagnostics.DebuggerNonUserCode()> _ 
    Protected Overrides Sub Dispose(ByVal disposing As Boolean) 
     Try 
      If disposing AndAlso components IsNot Nothing Then 
       components.Dispose() 
      End If 
     Finally 
      MyBase.Dispose(disposing) 
     End Try 
    End Sub 

    Private components As System.ComponentModel.IContainer 

    <System.Diagnostics.DebuggerStepThrough()> _ 
    Private Sub InitializeComponent() 
     components = New System.ComponentModel.Container 
     Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font 
     Me.Text = "BaseForm" 
    End Sub 
End Class 

처럼 보이는 새 속성을 제공하는 기본 폼 클래스가 있습니다. 이제 새 폼에서 BaseForm을 상속 할 때 HappyTime 속성이 속성 창에 false로 표시되고 편집 할 수 없습니다.

완전히 새로운 soloution이 BaseForm 및 상속 폼을 다시 및 HappyTime 속성을 편집 할 수 있으며 예상대로 작동합니다. 기존 프로젝트 (이러한 변경이 필요한 곳)에서 어떤 이유로 인해 올바르게 작동하지 않습니다.

이것은 내 프로젝트의 구성과 관련이 있다고 생각합니다. 누구든지 새로운 프로젝트를 만들고 모든 코드를이 프로젝트로 옮기는 것에 대한 짧은 통찰력을 가지고 있습니까?

환경 정보 : .Net Framework 3.5, Visual Studio 2010, Win7 x64

답변

1

의 _HappyTime 속성은 개인 또는 보호인가? 이 솔루션에서 Protected로 변경하면 작동 할 것입니다.

+0

네, 제 문제였습니다. 속성의 Set이 실수로 protected로 설정되었습니다. 일단 내가 그것을 제거, 예상대로 일했다. – jblaske