[Mono-winforms-list] Object reference not set to an instance of an object at System.Windows.Forms.XEventQueue+PaintQueue.Dequeue ()

2011-02-26 Thread Joao Paulo Rodrigues
Hi All I'm trying to port a C# application to MONO@Linux. All is working now (better than in windows) except for the ocasional crash at: System.Windows.Forms.XEventQueue+PaintQueue.Dequeue () . (Complete Stack trace bellow). The nature of the application makes this a terrible problem, because

Re: [Mono-winforms-list] object reference not set to an instance of an object

2010-11-01 Thread Robert Jordan
On 01.11.2010 16:56, Stifu wrote: > > Although you managed to work around your problem, if you think there is a bug > in Mono, feel free to file a bug report. ActiveForm is null when the application does not have focus, i.e. it's not activated in Windows parlance. A click on the desktop is enough

Re: [Mono-winforms-list] object reference not set to an instance of an object

2010-11-01 Thread Stifu
Although you managed to work around your problem, if you think there is a bug in Mono, feel free to file a bug report. luisrl wrote: > > I changed ActiveForm.Controls for this.Controls and now it works fine in > Ubuntu. > > foreach (Control ctl in this.Controls) > { >if (ctl.GetType() == t

Re: [Mono-winforms-list] object reference not set to an instance of an object

2010-11-01 Thread luisrl
I changed ActiveForm.Controls for this.Controls and now it works fine in Ubuntu. foreach (Control ctl in this.Controls) { if (ctl.GetType() == typeof(TextBox)) { ctl.Text = string.Empty; } } -- View this message in context: http://mono.1490590.n4.nabble.com/object-reference-not-s

Re: [Mono-winforms-list] object reference not set to an instance of an object

2010-11-01 Thread luisrl
I tried: if (ActiveForm == null) { MessageBox.Show("activeform null"); } And it shows the message; so, the activeform is null. -- View this message in context: http://mono.1490590.n4.nabble.com/object-reference-not-set-to-an-instance-of-an-object-tp3019792p307.html Sent from the Mono -

Re: [Mono-winforms-list] object reference not set to an instance of an object

2010-10-29 Thread Jonathan Pobst
Most likely it is ActiveForm.Controls. Check before this code with: if (ActiveForm == null) Console.WriteLine ("activeform null"); Jonathan On 10/29/2010 4:31 PM, luisrl wrote: > > I'm getting the next exception: > > object reference not set to an instance of an object > > In the next code

[Mono-winforms-list] object reference not set to an instance of an object

2010-10-29 Thread luisrl
I'm getting the next exception: object reference not set to an instance of an object In the next code: foreach (Control ctl in ActiveForm.Controls) { if (ctl.GetType() == typeof(TextBox)) { ctl.Text = string.Empty; } } This is happening in Ubuntu 10.04 + Mono 2.8, in Windows