Effect nonwished in wx.NET

Roger Zavala <[email protected]> Mon, 10 Oct 2005 16:24:17 -0400
Newsgroups gmane.comp.lib.wxwindows.wxnet
Message-ID <[email protected]>
Hi,

This is a old problem:

When i use wx.net <http://wx.net>, to repaint a wxObject (example, wxPanel,
wxStaticBitmap, etc), this wxObject blinking very ugly. I can't resolve
this.
This is a example the code, this to move a rectangle (100x100) over a
StaticBitmap:


public void CreateControls()
{
/*

Otro code here
...
*/

this.myStaticBitmap = (wx.StaticBitmap) wx.XmlResource.GetControl( this,
"ID_STATICBITMAP_VECTOR", typeof(wx.StaticBitmap) );
this.myStaticBitmap.MouseMove += new wx.EventListener( this.OnMouseMove );
}


public void OnMouseMove( object sender, wx.Event e )
{
wx.StaticBitmap staticBitmap = (wx.StaticBitmap) sender;
wx.MouseEvent mev = (wx.MouseEvent) e;
this.MoveRectangle( mev.X, mev.Y );

}

 public void MoveRectangle( int x, int y )
{
wx.MemoryDC mdc = new wx.MemoryDC();
mdc.Pen = pen;
mdc.Brush = brush;
wx.Bitmap b = new wx.Bitmap( 100, 100 );
mdc.SelectObject( b );
mdc.Background = wx.GDIBrushes.wxWHITE_BRUSH;
mdc.BackgroundMode = wx.FillStyle.wxSOLID;
mdc.Clear();
mdc.DrawRectangle( x, y, 100, 100 );
this.myStaticBitmap.Bitmap = b;
mdc.SelectObject( wx.NullObjects.wxNullBitmap );
mdc.Dispose();
}
Please, is urgen solve this nonwished effect in the cose :-(
 Thanks,
 Roger