Every control has a DrawToBitmap method, which copies the control to a bitmap even when it is partly or fully hidden by another control. Here's an example in the form of a function:
It works for most if not all controls apart from RichTextBoxes.Code:Private Function SnapShot(ByVal ctrl As Control) As Bitmap Dim bmp As Bitmap With ctrl bmp = New Bitmap(.Width, .Height) .DrawToBitmap(bmp, New Rectangle(0, 0, .Width, .Height)) End With Return bmp End Function
BB




Reply With Quote