There is a windows form application which i am trying to convert to wpf , but when i override onPaintBackground on main window using
protected override void OnPaintBackground(PaintEventArgs pevent)
There is error
no suitable method found to override
so what is the alternative for onPaintBackground in wpf ?.
In general you shouldn’t ‘paint’ in WPF. Because it can be very slow to continuously recreate the objects (Pens, brushes, shapes).
You can override the OnRender method, example from this page: