internal void SetScoreFeedback(string pFeedback, int pNumStars) { // InvokeRequired required compares the thread ID of the // calling thread to the thread ID of the creating thread. // If these threads are different, it returns true. if (this.scoreFeedback.InvokeRequired) { SetScoreFeedbackCallback d = new SetScoreFeedbackCallback(SetScoreFeedback); this.Invoke(d, new object[] { pFeedback, pNumStars }); } else { // this.scoreFeedback.Text = pFeedback; Graphics g = this.scoreFeedback.CreateGraphics(); for (int i = 0; i < pNumStars; i++) { g.DrawImage(mImage, 50 + i * 75, 25, 75, 75); } g.DrawString(pFeedback, mFontFeedback, System.Drawing.Brushes.Yellow, 50, 150); // this.scoreFeedback.Text = "\r\n\r\n\r\n\r\n" + pFeedback; g.Dispose(); } }
internal void SetScoreFeedback(string pFeedback, int pNumStars) { // InvokeRequired required compares the thread ID of the // calling thread to the thread ID of the creating thread. // If these threads are different, it returns true. if (this.scoreFeedback.InvokeRequired) { SetScoreFeedbackCallback d = new SetScoreFeedbackCallback(SetScoreFeedback); this.Invoke(d, new object[] { pFeedback, pNumStars }); } else { // this.scoreFeedback.Text = pFeedback; Graphics g = this.scoreFeedback.CreateGraphics(); for(int i= 0; i < pNumStars; i++) g.DrawImage(mImage, 50 + i * 75, 25, 75, 75); g.DrawString(pFeedback, mFontFeedback, System.Drawing.Brushes.Yellow, 50, 150); // this.scoreFeedback.Text = "\r\n\r\n\r\n\r\n" + pFeedback; g.Dispose(); } }