4
我有一個名爲EmployeeForm
的窗體,裏面包含一些用戶控件,當我編輯EmployeeForm
時,表單中的每個用戶控件都會丟失。編輯winForm時失去用戶控件VS2012
此圖顯示TFS(左)和本地(右)文件之間的差異修飾的組合框的名稱this.ucEmployeeKeyOne的
實施例後:
public partial class Employee_EmployeeKeyOneRelationUC
: Employee_EmployeeKeyOneRelation_GenericUC
{ [other Code Here] }
public class Employee_EmployeeKeyOneRelation_GenericUC
: RelationUC<MyObject>
{ }
和Relation的定義:
public partial class RelationUC<T>
: DataUserControlBase
{ [other Code Here] }
public partial class DataUserControlBase
: UserControlBase
{ [other Code Here] }
public partial class UserControlBase
: System.Windows.Forms.UserControl, MyInterfaceHere
{ [other Code Here] }
全部UserControl
我輸了從RelationUC<T>
繼承。 RelationUC的通用類型是否會導致問題?
IDE中的設計者有時會嚇壞了。你有沒有嘗試重新啓動Visual Studio? –
@PaulSasik是的,我試過。謝謝您的試用 –
檢查以確保您繼承的UC類可以通過IDE正確實例化。例如。確保有公共的構造函數,類不是抽象的等等。通過直接在設計器中打開繼承的控件來測試這個。 –