Force Paint refresh on control

NachitoMax 406 Reputation points


I am populating a picturebox with a view from an application. The picturebox isnt exactly showing an image, rather it is showing a visual view of a window. The 3rd party application requires a display object to hook into a uses its hwnd like this

oClientView = oAppDoc.ClientViews.Add(PictureBox1.Handle.ToInt32())

This is ok and displays as expected but, only displays once i have moved my mouse over it. Id like to try and force a paint event to do this as it loads but cannot really find anything useful.

How can i force a paint event to trigger in order to display the view?


.NET Standard
.NET Standard
A formal specification of .NET APIs that are available on multiple .NET implementations.
506 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Castorix31 71,866 Reputation points

    The standard ways to force a repaint are