frmColorToValue.cs

(开头部分) 3KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

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

namespace ResisiorTutorial
{
    public partial class frmColorToValue : Form
    {
        private Form parent;
        private int questionCount = 0;
        private DateTime startTime;
        private DateTime questionStartTime;
        private int lastQuestionCostTime = -1;
        private Color[] questionValue;
        private long questionAnswer;
        private bool errorFlag = false;
        private int correctCount = 0;

        public frmColorToValue(Form parent)
        {
            InitializeComponent();
            this.parent = parent;
        }

        private void frmColorToValue_FormClosing(object sender, FormClosingEventArgs e)
        {
            parent.Show();
        }

        private void NewQuestion()
        {
            questionCount++;
            questionStartTime = DateTime.Now;
            questionAnswer = ResistorValues.GetRandom();
            List<Color> l = new List<Color>();
            l.AddRange(ResistorHelper.GetColorFromValue(questionAnswer, true));
            l.Add(Color.Gold);
            questionValue = l.ToArray();
            resistorImage1.UpdateBand(questionValue);
            txtAnswer.Focus();
        }

        private void btnStart_Click(object sender, EventArgs e)
        {
            btnStart.Hide();
            panMain.Show();
            startTime = DateTime.Now;
            timer1.Start();
            NewQuestion();
        }

        private void txtAnswer_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                long answer = 0;
后面还有 37 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。