Invalidate() - NotSupportedException

using Visual Studio 2005 beta 2 / Compact Framework 2.0
I simply call Invalidate from a method within my Form and i get this ->
"An unhandled exception of type 'System.NotSupportedException' occurred in System.Drawing.dll
Additional information: An error message cannot be displayed because an optional resource assembly containing it cannot be found"
Any idea?
[392 byte] By [Adiraz] at [2007-12-16]
# 1
This smells like a bug, post a report on the Microsoft Product Feedback Center with code to reproduce it.
DavidM.Kean at 2007-9-9 > top of Msdn Tech,Smart Device Development,.NET Compact Framework...
# 2
Adiraz,

From which method in your Form are you calling Invalidate()? Are you on a different thread? Just prior to calling Invalidate(), what does this.InvokeRequired return?

timg_msft at 2007-9-9 > top of Msdn Tech,Smart Device Development,.NET Compact Framework...
# 3
I have re-aranged my code since then, but I remember trying it a few places before posting here. One of them was in a datareceived event method on a SerialPort object. I ended up havin to use CreateGraphics to get around it, but playing around tonight found that indeed Update()/Refresh() work now so who knows, but i won't be testing it it back in the serial port thing. This was before I knew about threads or invoke.
Adiraz at 2007-9-9 > top of Msdn Tech,Smart Device Development,.NET Compact Framework...
# 4
Hi Adiraz,

Note that SerialPort events are handled by a ThreadPool thread so if you need to update any properties for a GUI control, you would need to use Control.Invoke() instead of setting them directly.

Cheers,
Anthony

AnthonyWong at 2007-9-9 > top of Msdn Tech,Smart Device Development,.NET Compact Framework...