none
我是初学者,编起的程序不能生成 调试 能帮忙指出问题并修改 RRS feed

  • 问题

  • using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;

    namespace selfexam
    {
        public partial class PrimaryExmForm : Form
        {
            public PrimaryExmForm()
            {
                InitializeComponent();
            }

            private void radioButton1_CheckedChanged(object sender, EventArgs e)
            {

            }

            private void timer1_Tick(object sender, EventArgs e)
            {
               namespace selfexam
    {public Partial class PrimaryExmForm : Form
        {
            public PrimaryExmForm()
            {
                InitializeComponent();
            }
            int ExamEecond = 0;

            private void timer1_Tick(object sender, EventArgs e)
            {
                ExamSecond++;
                this.ExamTime.Text = examsecond.ToString();

             }
          
         
               }

            private void btnGrade_Click(object sender, EventArgs e)
            {
             int Score = 0;
                if (this.Anwser1.text=="2000") score=score+10;
                if (this.Anwser21A.checked) score=score+10;
                if (this.Anwser22C.checked) score=score+10;
                if (this.Anwser23.text=="PasswordChar") score=score+10;
                if (this.Anwser24.text=="text") score=score+10;
                if (this.Anwser3A.checked && this.Anwser3B.checked && this.Anwser3C.checked && !this.Anwser3D.checked &&  ) score=score+10;
                this.timer1.Enablled=false ;
                this.bntGrade.Enabled= flase;
                this.TotalScore.Text = score.ToString();
            }

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


    2015年1月7日 11:32

答案

  • 你好,

    不太清楚你这段代码是哪里来的,结构有点乱,大括号都对应不起来,应该是下面这样子才对。

    如果你对Windows Forms编程不了解的话,建议你先找一个完整的教程从C#语言开始学习。

    namespace selfexam
    {
        public partial class PrimaryExmForm : Form
        {
            public PrimaryExmForm()
            {
                InitializeComponent();
            }
    
             int ExamEecond = 0;
    
            private void timer1_Tick(object sender, EventArgs e)
             {
                 ExamSecond++;
                 this.ExamTime.Text = examsecond.ToString();
    
             }
    
            private void btnGrade_Click(object sender, EventArgs e)
             {
              int Score = 0;
                 if (this.Anwser1.text=="2000") score=score+10;
                 if (this.Anwser21A.checked) score=score+10;
                 if (this.Anwser22C.checked) score=score+10;
                 if (this.Anwser23.text=="PasswordChar") score=score+10;
                 if (this.Anwser24.text=="text") score=score+10;
                 if (this.Anwser3A.checked && this.Anwser3B.checked && this.Anwser3C.checked && !this.Anwser3D.checked &&  ) score=score+10;
                 this.timer1.Enablled=false ;
                 this.bntGrade.Enabled= flase;
                 this.TotalScore.Text = score.ToString();
             }
    
            private void bntClose_Click(object sender, EventArgs e)
             {
                 this.Close;
             }
    
        }
    }


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    2015年1月8日 7:29
    版主