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=75884 --- shadow/75884 2005-10-06 21:10:15.000000000 -0400 +++ shadow/75884.tmp.19977 2005-10-07 08:57:59.000000000 -0400 @@ -1,19 +1,19 @@ Bug#: 75884 Product: Mono: Class Libraries Version: 1.1 OS: unknown -OS Details: Slackware 10.1 -Status: RESOLVED -Resolution: NOTABUG +OS Details: [EMAIL PROTECTED] +Status: REOPENED +Resolution: Severity: Unknown Priority: Cosmetic Component: Windows.Forms AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] -QAContact: [EMAIL PROTECTED] +QAContact: [EMAIL PROTECTED] TargetMilestone: --- URL: Cc: Summary: Form updated from an external thread doesn't redraw. Description of Problem: @@ -87,6 +87,65 @@ to work when you run it, but thats more of a lucky timing thing. According to the docs you shouldn't be accessing your control from another thread except with the BeginInvoke stuff. ------- Additional Comments From [EMAIL PROTECTED] 2005-10-06 21:10 ------- Yeah this isn't legal look at using Control::BeginInvoke + +------- Additional Comments From [EMAIL PROTECTED] 2005-10-07 08:57 ------- +I did check, and indeed, the code wasn't legal. However, the problem +persists after correcting it. + +Corrected code: + +using System; +using System.Windows.Forms; +using System.Threading; + +public class main +{ + public static void Main() + { + form test = new form(); + Thread.Sleep(1000); + + delegt = new DoSth(test.doSth); + IAsyncResult ar = delegt.BeginInvoke("some text",null,null); + delegt.EndInvoke(ar); + + Thread.Sleep(1000); + + closet = new CloseIt(test.Close); + ar = closet.BeginInvoke(null,null); + closet.EndInvoke(ar); + } + protected static DoSth delegt; + protected static CloseIt closet; +} + +public class form : Form +{ + protected ListBox listBox1; + public form() + { + listBox1 = new ListBox(); + Controls.Add(listBox1); + + Thread t = new Thread(new ThreadStart(threadProc)); + t.IsBackground = true; + t.Start(); + } + + protected void threadProc() + { + ShowDialog(); + } + public void doSth(string what) + { + listBox1.Items.Add(what); + listBox1.Refresh(); + } +} +public delegate void DoSth(string what); +public delegate void CloseIt(); + +The result is still the same... _______________________________________________ mono-bugs maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-bugs
