Please do not reply to this email- if you want to comment on the bug, go to the URL shown below and enter your comments there.
Changed by [EMAIL PROTECTED] http://bugzilla.ximian.com/show_bug.cgi?id=78756 --- shadow/78756 2006-07-04 13:53:55.000000000 -0400 +++ shadow/78756.tmp.10936 2006-07-05 10:31:39.000000000 -0400 @@ -4,20 +4,20 @@ OS: unknown OS Details: Status: NEW Resolution: Severity: Unknown Priority: Normal -Component: Sys.Drawing. +Component: Windows.Forms AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] QAContact: [EMAIL PROTECTED] TargetMilestone: --- URL: Cc: -Summary: Graphics: DrawString doesn't the string if a call to FillRectangle is next. +Summary: Refresh problem during a Thread.Sleep This is a small sample from a Windows.Forms book, which shows a button, and when clicked, a text appears for a fraction of a second. This example calls Form.CreateGraphics (), Graphics.DrawString () and Graphics.FillRectangle. @@ -92,6 +92,58 @@ ------- Additional Comments From [EMAIL PROTECTED] 2006-07-04 13:53 ------- I'm sorry, but I'm having some connection problems with my internet service provider, and right now I can't post any text with more than 30 lines to bugzilla (this should change as I'm going to change of provider). + +------- Additional Comments From [EMAIL PROTECTED] 2006-07-05 10:31 ------- +It seems to be a SWF refresh problem as this code (changing +button.Text) provoke an update and works as expected. + +Updated Summary and moved back to MWF. + + +// mcs 78756.cs -r:System.Windows.Forms.dll -r:System.Drawing.dll + +using System; +using System.Windows.Forms; +using System.Drawing; +using System.Threading; + +public class TestForm : Form { + + private Button button; + + public TestForm () + { + button = new Button (); + button.Parent = this; + button.Location = new Point (50, 50); + button.Text = "Click me"; + button.Click += OnButtonClick; + } + + void OnButtonClick (object o, EventArgs args) + { + Graphics graphics = CreateGraphics (); + Point point = new Point (0, 0); + string str = "User click."; + + graphics.DrawString (str, Font, new SolidBrush +(ForeColor), point); + // This allows the text to appear in the form + button.Text = "wait"; + Thread.Sleep (1000 * 10); + // 'Clean' form + graphics.FillRectangle (new SolidBrush (BackColor), +new RectangleF (point, graphics.MeasureString (str, Font))); + button.Text = "Click me"; + graphics.Dispose (); + } + + static void Main () + { + Application.Run (new TestForm ()); + } +} + _______________________________________________ mono-bugs maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-bugs
