1

양식에 UserControl을 추가하는 데 문제가 있습니다.내 양식에 UserControl을 추가 할 때 오류가 발생했습니다.

UserControl을 코드 ​​: 오류의 사진 아래

using System; 
using System.Windows.Forms; 

namespace Most.Mobile.AFV.UI.Controls 
{ 
    public partial class ListActionBar : UserControl 
    { 
     public ListActionBar() 
     { 
      InitializeComponent(); 
     } 

     public bool ShowKeyboardButton 
     { 
      get { return mtbKeyboard.Visible; } 
      set { mtbKeyboard.Visible = value; } 
     } 

     public bool ShowOpenButton 
     { 
      get { return mtbMenu.Visible; } 
      set { mtbMenu.Visible = value; } 
     } 

     public bool ShowDeleteButton 
     { 
      get { return mtbDelete.Visible; } 
      set { mtbDelete.Visible = value; } 
     } 

     public bool ShowBackButton 
     { 
      get { return mtbBack.Visible; } 
      set { mtbBack.Visible = value; } 
     } 

     public bool ShowEditButton 
     { 
      get { return mtbEdit.Visible; } 
      set { mtbEdit.Visible = value; } 
     } 

     public bool ShowNewButton 
     { 
      get { return mtbNew.Visible; } 
      set { mtbNew.Visible = value; } 
     } 

     public event EventHandler NewClick; 
     public event EventHandler DeleteClick; 
     public event EventHandler EditClick; 
     public event EventHandler OpenClick; 

     private void mtbBack_Click(object sender, EventArgs e) 
     { 
      if (Parent == null) 
       return; 

      if (Parent is Form) 
       (Parent as Form).DialogResult = DialogResult.Cancel; 
     } 

     private void mtbKeyboard_Click(object sender, EventArgs e) 
     { 
      inp.Enabled = !inp.Enabled; 
     } 

     private void mtbNew_Click(object sender, EventArgs e) 
     { 
      if (NewClick != null) 
       NewClick(sender, e); 
     } 

     private void mtbEdit_Click(object sender, EventArgs e) 
     { 
      if (EditClick != null) 
       EditClick(sender, e); 
     } 

     private void mtbDelete_Click(object sender, EventArgs e) 
     { 
      if (DeleteClick != null) 
       DeleteClick(sender, e); 
     } 

     private void mtbMenu_Click(object sender, EventArgs e) 
     { 
      if (OpenClick != null) 
       OpenClick(sender, e); 
     } 
    } 
} 

Error image

오류 설명 :

구성 요소 '' 'System.IO.FileLoadException을 만들 수 없습니다 : 파일 또는 어셈블리 'Microsoft.WindowsCE.Forms, 버전 = 3.5.0.0, CUlture = 중립, PublicKeyToken = 9로드 할 수 없습니다. 69db8053d3322ac '또는 그 종속성 중 하나가됩니다.

답변

-1

시각적 스튜디오 디자이너는 디자이너보기에서 컨트롤을 표시 할 때이를 인스턴스화합니다. 이와 같은 오류가 발생하면 일반적으로 런타임 버그가 있음을 의미합니다. 코드가 컴파일되면 (디자이너에서 열지 않고) 코드를 실행하고 충돌이 발생한 곳을 확인하십시오.

+0

다른 세부 사항 나는 언급하는 것을 잊었다 : 프로젝트는 Windows Mobile 6.5에있다. 내 컴퓨터에서이 오류가 발생하지 않습니다. 오류가 내 동료의 컴퓨터에서만 발생합니다 런타임 모드에서 완벽하게 작동합니다. – ridermansb

관련 문제