2017-04-09 6 views
-1

に作業していない私のファイル名を変更し、私は誤って2015 Visual Studioで私のフォーム名を変更し、私が取り消ししようとすると、今私は113のエラーは今、何は、Visual Studio 2015のC#

enter image description here

enter image description here

を取得します

using MaterialSkin.Controls; 
using System; 
using System.ComponentModel; 
using System.Windows.Forms; 
using System.Text.RegularExpressions; 

namespace WindowsFormsApp2 
{ 
    public partial class Dogana : MaterialForm 
    { 
     public Dogana() 
     { 
      InitializeComponent(); 
     } 
     protected override bool ProcessCmdKey(ref Message msg, Keys keyData) 
     { // Close whole with ESC 
      if (keyData == Keys.Escape) 
      { 
       this.Close(); 
       return true; 
      } 
      return base.ProcessCmdKey(ref msg, keyData); 
     } 

     private void Form1_Load(object sender, EventArgs e) 
     { 

     } 


     private void materialSingleLineTextField1_Click(object sender, EventArgs e) 
     { 


     } 

     private void materialSingleLineTextField2_Click(object sender, EventArgs e) 
     { 

     } 

     private void kalkulo_Click(object sender, EventArgs e) 
     { 
      double vlera_akcizes = 0; 
      double vlera_tvsh = 0; 
      string euro = "€"; 
      try 
      { 
#region Kubik 0-2000 
       if (Regex.IsMatch(Viti_prodhimit.Text, "[^0-9]") && Regex.IsMatch(vlera.Text, "[^0-9]")) 
       { 
        double Viti_val = double.Parse(Viti_prodhimit.Text); 
        double Vlera_val = double.Parse(vlera.Text); //Fix this 
        double tatimi_vleres = Vlera_val * 0.10; 
        double max_tvsh = (Vlera_val + tatimi_vleres) * 0.18; 


        if (Viti_val == 2017 && dymi.Checked) 
        { 
         akciza1.Text = vlera_akcizes.ToString() + euro; 
         tatimi1.Text = tatimi_vleres.ToString() + euro; 
         tvsh1.Text = max_tvsh.ToString(); 


         total1.Text = Convert.ToString(tatimi_vleres + max_tvsh + euro); 
         total2.Text = Convert.ToString(tatimi_vleres + max_tvsh + Vlera_val + euro); 
        } 
        else if (Viti_val <= 2016 && Viti_val >= 2009 && dymi.Checked) 
        { 
         vlera_akcizes = 400; 
         vlera_tvsh = 72; 
         akciza1.Text = vlera_akcizes.ToString() + euro; 
         tatimi1.Text = tatimi_vleres.ToString() + euro; 
         tvsh1.Text = Convert.ToString(max_tvsh + vlera_tvsh) + euro; 

         total1.Text = Convert.ToString(vlera_akcizes + tatimi_vleres + max_tvsh + vlera_tvsh + euro); 
         total2.Text = Convert.ToString(vlera_akcizes + tatimi_vleres + max_tvsh + Vlera_val + vlera_tvsh + euro); 

        } 
        else if (Viti_val == 2008 && dymi.Checked) 
        { 
         vlera_akcizes = 600; 
         vlera_tvsh = 108; 
         akciza1.Text = vlera_akcizes.ToString() + euro; 
         tatimi1.Text = tatimi_vleres.ToString() + euro; 
         tvsh1.Text = Convert.ToString(max_tvsh + vlera_tvsh) + euro; 

         total1.Text = Convert.ToString(vlera_akcizes + tatimi_vleres + max_tvsh + vlera_tvsh + euro); 
         total2.Text = Convert.ToString(vlera_akcizes + tatimi_vleres + max_tvsh + Vlera_val + vlera_tvsh + euro); 

        } 
        else if (Viti_val == 2007 && dymi.Checked) 
        { 
         vlera_akcizes = 700; 
         vlera_tvsh = 126; 
         akciza1.Text = vlera_akcizes.ToString() + euro; 
         tatimi1.Text = tatimi_vleres.ToString() + euro; 
         tvsh1.Text = Convert.ToString(max_tvsh + vlera_tvsh) + euro; 

         total1.Text = Convert.ToString(vlera_akcizes + tatimi_vleres + max_tvsh + vlera_tvsh + euro); 
         total2.Text = Convert.ToString(vlera_akcizes + tatimi_vleres + max_tvsh + Vlera_val + vlera_tvsh + euro); 

        } 
        else if (Viti_val == 2006 && dymi.Checked) 
        { 
         vlera_akcizes = 800; 
         vlera_tvsh = 144; 
         akciza1.Text = vlera_akcizes.ToString() + euro; 
         tatimi1.Text = tatimi_vleres.ToString() + euro; 
         tvsh1.Text = Convert.ToString(max_tvsh + vlera_tvsh) + euro; 

         total1.Text = Convert.ToString(vlera_akcizes + tatimi_vleres + max_tvsh + vlera_tvsh + euro); 
         total2.Text = Convert.ToString(vlera_akcizes + tatimi_vleres + max_tvsh + Vlera_val + vlera_tvsh + euro); 

        } 
        else if (Viti_val == 2005 && dymi.Checked) 
        { 
         vlera_akcizes = 900; 
         vlera_tvsh = 162; 
         akciza1.Text = vlera_akcizes.ToString() + euro; 
         tatimi1.Text = tatimi_vleres.ToString() + euro; 
         tvsh1.Text = Convert.ToString(max_tvsh + vlera_tvsh) + euro; 

         total1.Text = Convert.ToString(vlera_akcizes + tatimi_vleres + max_tvsh + vlera_tvsh + euro); 
         total2.Text = Convert.ToString(vlera_akcizes + tatimi_vleres + max_tvsh + Vlera_val + vlera_tvsh + euro); 

        } 
        else if (Viti_val == 2004 && dymi.Checked) 
        { 
         vlera_akcizes = 1000; 
         vlera_tvsh = 180; 
         akciza1.Text = vlera_akcizes.ToString() + euro; 
         tatimi1.Text = tatimi_vleres.ToString() + euro; 
         tvsh1.Text = Convert.ToString(max_tvsh + vlera_tvsh) + euro; 

         total1.Text = Convert.ToString(vlera_akcizes + tatimi_vleres + max_tvsh + vlera_tvsh + euro); 
         total2.Text = Convert.ToString(vlera_akcizes + tatimi_vleres + max_tvsh + Vlera_val + vlera_tvsh + euro); 

        } 
        else if (Viti_val == 2003 && dymi.Checked) 
        { 
         vlera_akcizes = 1100; 
         vlera_tvsh = 198; 
         akciza1.Text = vlera_akcizes.ToString() + euro; 
         tatimi1.Text = tatimi_vleres.ToString() + euro; 
         tvsh1.Text = Convert.ToString(max_tvsh + vlera_tvsh) + euro; 

         total1.Text = Convert.ToString(vlera_akcizes + tatimi_vleres + max_tvsh + vlera_tvsh + euro); 
         total2.Text = Convert.ToString(vlera_akcizes + tatimi_vleres + max_tvsh + Vlera_val + vlera_tvsh + euro); 

        } 
        else if (Viti_val == 2002 && dymi.Checked) 
        { 
         vlera_akcizes = 1200; 
         vlera_tvsh = 216; 
         akciza1.Text = vlera_akcizes.ToString() + euro; 
         tatimi1.Text = tatimi_vleres.ToString() + euro; 
         tvsh1.Text = Convert.ToString(max_tvsh + vlera_tvsh) + euro; 

         total1.Text = Convert.ToString(vlera_akcizes + tatimi_vleres + max_tvsh + vlera_tvsh + euro); 
         total2.Text = Convert.ToString(vlera_akcizes + tatimi_vleres + max_tvsh + Vlera_val + vlera_tvsh + euro); 

        } 
        else if (Viti_val == 2001 && dymi.Checked) 
        { 
         vlera_akcizes = 1300; 
         vlera_tvsh = 234; 
         akciza1.Text = vlera_akcizes.ToString() + euro; 
         tatimi1.Text = tatimi_vleres.ToString() + euro; 
         tvsh1.Text = Convert.ToString(max_tvsh + vlera_tvsh) + euro; 

         total1.Text = Convert.ToString(vlera_akcizes + tatimi_vleres + max_tvsh + vlera_tvsh + euro); 
         total2.Text = Convert.ToString(vlera_akcizes + tatimi_vleres + max_tvsh + Vlera_val + vlera_tvsh + euro); 

        } 
        else if (Viti_val <= 2000 && dymi.Checked) 
        { 
         vlera_akcizes = 1500; 
         vlera_tvsh = 270; 
         akciza1.Text = vlera_akcizes.ToString() + euro; 
         tatimi1.Text = tatimi_vleres.ToString() + euro; 
         tvsh1.Text = Convert.ToString(max_tvsh + vlera_tvsh) + euro; 

         total1.Text = Convert.ToString(vlera_akcizes + tatimi_vleres + max_tvsh + vlera_tvsh + euro); 
         total2.Text = Convert.ToString(vlera_akcizes + tatimi_vleres + max_tvsh + Vlera_val + vlera_tvsh + euro); 

        } 
       } 
       else 
       { 
        MessageBox.Show("Vetem numra"); 

       } 
       #endregion 
      } 
      catch (Exception) 
      { 

       MessageBox.Show("Vetem numra"); 
      } 







     } 

     private void Viti_prodhimit_Validating(object sender, CancelEventArgs e) 
     { 

     } 

     private void Viti_prodhimit_KeyPress(object sender, KeyPressEventArgs e) 
     { 
     } 

     private void btnReset_Click(object sender, EventArgs e) 
     { 
      Viti_prodhimit.Text = " "; 
      vlera.Text = " "; 
      tvsh1.Text = " "; 
      akciza1.Text = ""; 
      tatimi1.Text = " "; 
      total1.Text = " "; 
      total2.Text = ""; 
      //MessageBox.Show("Te dhenat u resetuan"); 
      MyToolTip.Show("Kudo ne aplikacion.", btnReset); 
     } 



     private void Dogana_MouseDoubleClick(object sender, MouseEventArgs e) 
     { 

      Viti_prodhimit.Text = " "; 
      vlera.Text = " "; 

      tvsh1.Text = " "; 
      akciza1.Text = ""; 
      tatimi1.Text = " "; 
      total1.Text = " "; 
      total2.Text = ""; 
      //MessageBox.Show("Te dhenat u resetuan"); 
     } 
     private void MyToolTip_Popup(object sender, PopupEventArgs e) 
     { 

     } 

     private void Context_Opening(object sender, CancelEventArgs e) 
     { 

     } 


     #region onTopToggle 
     private void metroToggle1_CheckedChanged(object sender, EventArgs e) 
     { 
      if (onTopToggle.Checked) 
      { 
       TopMost = true; 
      } 
      else 
      { 
       TopMost = false; 
      } 
     } 
#endregion 

     #region ToolTip Options 
     private void resetToolStripMenuItem_Click(object sender, EventArgs e) 
     { 
      Viti_prodhimit.Text = " "; 
      vlera.Text = " "; 
      tvsh1.Text = " "; 
      akciza1.Text = ""; 
      tatimi1.Text = " "; 
      total1.Text = " "; 
      total2.Text = ""; 
      //MessageBox.Show("Te dhenat u resetuan"); 
     } 

     private void exitToolStripMenuItem_Click(object sender, EventArgs e) 
     { 
      this.Close(); 

     } 

     private void toolStripMenuItem2_Click(object sender, EventArgs e) 
     { 
      Viti_prodhimit.Text = "2017"; 
     } 

     private void toolStripMenuItem3_Click(object sender, EventArgs e) 
     { 
      Viti_prodhimit.Text = "2016"; 
     } 

     private void toolStripMenuItem4_Click(object sender, EventArgs e) 
     { 
      Viti_prodhimit.Text = "2015"; 
     } 

     private void toolStripMenuItem5_Click(object sender, EventArgs e) 
     { 
      Viti_prodhimit.Text = "2014"; 
     } 

     private void toolStripMenuItem6_Click(object sender, EventArgs e) 
     { 
      Viti_prodhimit.Text = "2013"; 
     } 

     private void toolStripMenuItem7_Click(object sender, EventArgs e) 
     { 
      Viti_prodhimit.Text = "2012"; 
     } 

     private void toolStripMenuItem8_Click(object sender, EventArgs e) 
     { 
      Viti_prodhimit.Text = "2011"; 
     } 

     private void toolStripMenuItem9_Click(object sender, EventArgs e) 
     { 
      Viti_prodhimit.Text = "2010"; 
     } 

     private void toolStripMenuItem10_Click(object sender, EventArgs e) 
     { 
      Viti_prodhimit.Text = "2009"; 
     } 

     private void toolStripMenuItem11_Click(object sender, EventArgs e) 
     { 
      Viti_prodhimit.Text = "2008"; 
     } 

     private void toolStripMenuItem12_Click(object sender, EventArgs e) 
     { 
      Viti_prodhimit.Text = "2007"; 
     } 

     private void toolStripMenuItem13_Click(object sender, EventArgs e) 
     { 
      Viti_prodhimit.Text = "2006"; 
     } 

     private void toolStripMenuItem14_Click(object sender, EventArgs e) 
     { 
      Viti_prodhimit.Text = "2005"; 
     } 

     private void toolStripMenuItem15_Click(object sender, EventArgs e) 
     { 
      Viti_prodhimit.Text = "2004"; 
     } 

     private void toolStripMenuItem16_Click(object sender, EventArgs e) 
     { 
      Viti_prodhimit.Text = "2003"; 
     } 

     private void toolStripMenuItem17_Click(object sender, EventArgs e) 
     { 
      Viti_prodhimit.Text = "2002"; 
     } 

     private void toolStripMenuItem18_Click(object sender, EventArgs e) 
     { 
      Viti_prodhimit.Text = "2001"; 
     } 

     private void toolStripMenuItem19_Click(object sender, EventArgs e) 
     { 
      Viti_prodhimit.Text = "2000"; 
     } 
    } 
#endregion 
} 
01:グローバル私は、このエラー

はここに私のコードです取得します

ゼロから始めずにこれらのすべてを修正する方法はありますか?

答えて

0

フォーム名の変更方法によって異なります。 Form.Designer.csファイルを開き、そこにある部分クラスの名前を確認します。

+0

これはWindowsForm1であり、私はDoganaに変更しましたが、これをどのように逆にしますか? – Nex

+0

クラスフォームの名前を右クリックし、コンテキストメニューから[名前の変更...]を選択します。 –

0

あり、それを行うための一つの方法である(他の回答で問題が解決しない場合は、あなたがソース管理システムを使用していない場合):

  1. を経由してコンパイルされたクラスで、デバッグ/リリースのフォルダからプロジェクトのDLLを開きます。 ILSpyツール(.NET Reflectorもオプションで可能)
  2. Setビュー最後successfulyコンパイルされたファイルのコピー/グラブテキスト
  3. C#などの代わりに、IL
  4. とバックプロジェクトに貼り付けます。

この方法は、エラーが発生する前に正常にビルドされていて、ソリューションフォルダをクリーニングしなかった場合に機能します(これは少し変更することができますが、名前はほぼ同じでアプリが動作するはずです) 。私の場合は、フォームのないdllであり、誤っていくつかのファイルを削除してしまった。フォームとform.designerクラスの両方をコピーする必要があることを除いて、あなたのケースはほぼ同じです。

しかし、今後はGitや他のVCSの使用を開始することをお勧めします。

0

私のソリューションでした:

  1. [移動]メニューの[ツール]→[拡張機能と更新
  2. は、「更新」リンクをチェックしてください...マイクロソフトASP.NETとWebツールへの更新がありました。
  3. インストールしてください。

それを修正しました。

0

.csファイル名をクラス名と一致するように変更してください。 Form1.csからこの場合はDogana.csに、それ以外のものにするには

+0

Window.Formsプロジェクトを参照してください。 – ivamax9

+0

@ ivamax9そうです。私は私の答えを編集しました。問題と出力エラーは、WPFとほぼ同じように見えますが、InitializeComponent() – Demo