Exemple #1
0
        public Form2(string questionstr, string id, string numberstr, string classid, string lessonid)
        {
            mode      = 1;
            tm_create = DateTime.Now;

            Log.Info("From2.create, questionstr=" + questionstr + ", id=" + id + ", classid=" + classid + ", lessonid=" + lessonid);
            al         = new ArrayList();
            alText     = new ArrayList();
            clickstate = new ArrayList();
            _id        = id;

            InitializeComponent();
            SetPanel(numberstr);
            SetDesktopLocation(0, screenHeight - this.Height);

            this.Text        = "习题[" + id + "]";
            this.WindowState = FormWindowState.Maximized;
            this.TopMost     = true;
#if DEBUG
            this.TopMost = false;//Form2.xiti. zzz
#endif

            Xiti xiti = JsonOper.DeserializeJsonToObject <Xiti>(questionstr);
            m_answer = xiti.answer;
            string content = xiti.content;
            string html    = "<div style=\"border-top:solid 3px #0B95C8; width:100%; margin-top:30px; padding-top:70px;\"><table align=\"center\"><tr><td style=\"font-family:微软雅黑; font-size:32px;\">" + content + "</td></tr></table></div>";
            this.webBrowser1.DocumentText = html;

            t           = new System.Timers.Timer(200);
            t.Elapsed  += new System.Timers.ElapsedEventHandler(Theout);
            t.Enabled   = true;
            t.AutoReset = true;
        }
Exemple #2
0
        public void Xiti(string questionstr, string rid)
        {
            mode      = 2;
            this.Text = "分组练习";
            if (rid != null && rid.Length > 0 && questionstr.Length > 0)
            {
                bWithXitiResource = true;
                Xiti xiti = JsonOper.DeserializeJsonToObject <Xiti>(questionstr);
                answer = xiti.answer;
                string content = xiti.content;
                string html    = "<div style=\"border-top:solid 3px #0B95C8; width:100%; margin-top:30px; padding-top:70px;\"><table align=\"center\"><tr><td style=\"font-family:微软雅黑; font-size:32px;\">" + content + "</td></tr></table></div>";
                this.webBrowser1.DocumentText = html;
            }

            int panelH = SetPanel_Group();

            if (bWithXitiResource)
            {
                this.Width    = screenWidth;
                this.Height   = screenHeight;
                StartPosition = FormStartPosition.Manual;
                SetDesktopLocation(0, 0);
            }
            else
            {
                this.Height   = panelH;
                this.Width    = screenWidth;
                StartPosition = FormStartPosition.Manual;
                SetDesktopLocation(0, screenHeight - this.Height);
            }

            this.Hide();
            this.Show();
            this.BringToFront();
            panel1.Show();
            panel1.BringToFront();

            t           = new System.Timers.Timer(200);
            t.Elapsed  += new System.Timers.ElapsedEventHandler(Theout);
            t.Enabled   = true;
            t.AutoReset = true;
        }